mirror of
https://github.com/openai/codex.git
synced 2026-05-04 05:11:37 +03:00
Pre-sampling compact with previous model context (#11504)
- Run pre-sampling compact through a single helper that builds previous-model turn context and compacts before the follow-up request when switching to a smaller context window. - Keep compaction events on the parent turn id and add compact suite coverage for switch-in-session and resume+switch flows.
This commit is contained in:
@@ -153,7 +153,7 @@ impl Session {
|
||||
if !task_cancellation_token.is_cancelled() {
|
||||
// Emit completion uniformly from spawn site so all tasks share the same lifecycle.
|
||||
let sess = session_ctx.clone_session();
|
||||
sess.on_task_finished(ctx_for_finish, last_agent_message)
|
||||
sess.on_task_finished(Arc::clone(&ctx_for_finish), last_agent_message)
|
||||
.await;
|
||||
}
|
||||
// Set previous model regardless of completion or interruption for model-switch handling.
|
||||
|
||||
Reference in New Issue
Block a user