From 0c88f58519f4079edb41be632697aacb0aad9199 Mon Sep 17 00:00:00 2001 From: Cooper Gamble Date: Tue, 10 Mar 2026 02:31:34 +0000 Subject: [PATCH] [core] refresh inline compaction comments [ci changed_files] Co-authored-by: Codex --- codex-rs/core/src/codex.rs | 2 +- codex-rs/core/src/stream_events_utils.rs | 2 +- codex-rs/core/tests/suite/compact_remote.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index a5e441cd41..9027760418 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -6015,7 +6015,7 @@ async fn run_pre_sampling_compact( .model_info .auto_compact_token_limit() .unwrap_or(i64::MAX); - // Compact if the total usage tokens are greater than the auto compact limit + // Compact if the total usage tokens are greater than or equal to the auto-compact limit. if total_usage_tokens >= auto_compact_limit { if inline_server_side_compaction_threshold(sess, turn_context).is_some() { record_compaction_metric( diff --git a/codex-rs/core/src/stream_events_utils.rs b/codex-rs/core/src/stream_events_utils.rs index f54f8a5f08..db138b5c87 100644 --- a/codex-rs/core/src/stream_events_utils.rs +++ b/codex-rs/core/src/stream_events_utils.rs @@ -178,7 +178,7 @@ pub(crate) async fn handle_output_item_done( _ => ContextCompactionItem::new(), }); // Preserve the raw wire event immediately; the caller rewrites local history inline and - // then continues appending later same-turn output after the checkpoint item. + // then continues appending later same-turn output after the compaction item. debug!( turn_id = %ctx.turn_context.sub_id, "emitting streamed server-side raw compaction item for immediate local checkpoint apply" diff --git a/codex-rs/core/tests/suite/compact_remote.rs b/codex-rs/core/tests/suite/compact_remote.rs index 6e021c4bb7..70f2f44cc6 100644 --- a/codex-rs/core/tests/suite/compact_remote.rs +++ b/codex-rs/core/tests/suite/compact_remote.rs @@ -733,8 +733,8 @@ async fn auto_server_side_compaction_follow_ups_use_compaction_checkpoint() -> R } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn auto_server_side_compaction_retries_without_committing_incomplete_checkpoint() -> Result<()> -{ +async fn auto_server_side_compaction_retries_without_persisting_failed_compaction_item() +-> Result<()> { skip_if_no_network!(Ok(())); let compact_threshold = 120; @@ -805,7 +805,7 @@ async fn auto_server_side_compaction_retries_without_committing_incomplete_check let third_turn_request = &requests[3]; assert!( !third_turn_request.body_contains_text(&inline_summary), - "failed inline compaction should not rewrite local history before a retry succeeds" + "failed inline compaction should not persist its compaction item into later turns" ); assert!( third_turn_request.body_contains_text(first_turn_text),