mirror of
https://github.com/openai/codex.git
synced 2026-11-03 00:21:31 +00:00
Ensure auto-compaction starts after turn started (#10129)
Start auto-compaction only after TurnStarted is emitted.\nAdd an integration test for deterministic ordering.
This commit is contained in:
1 parent
8497163363
commit
26590d7927
2 files changed
+98
-3
No files matched your search
@@ -3151,13 +3151,13 @@ pub(crate) async fn run_turn(
|
||||
let model_info = turn_context.client.get_model_info();
|
||||
let auto_compact_limit = model_info.auto_compact_token_limit().unwrap_or(i64::MAX);
|
||||
let total_usage_tokens = sess.get_total_token_usage().await;
|
||||
if total_usage_tokens >= auto_compact_limit {
|
||||
run_auto_compact(&sess, &turn_context).await;
|
||||
}
|
||||
let event = EventMsg::TurnStarted(TurnStartedEvent {
|
||||
model_context_window: turn_context.client.get_model_context_window(),
|
||||
});
|
||||
sess.send_event(&turn_context, event).await;
|
||||
if total_usage_tokens >= auto_compact_limit {
|
||||
run_auto_compact(&sess, &turn_context).await;
|
||||
}
|
||||
|
||||
let skills_outcome = Some(
|
||||
sess.services
|
||||
|
||||
Reference in new issue
Block a user