From de959aafa29fe3069b504657cba31f4ee9c8d8ae Mon Sep 17 00:00:00 2001 From: Charles Cunningham Date: Sun, 15 Feb 2026 17:16:35 -0800 Subject: [PATCH] Comments --- codex-rs/core/src/codex.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index 1110fa3d51..497fecac0f 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -4685,12 +4685,10 @@ async fn maybe_run_previous_model_inline_compact( match run_auto_compact( sess, + // We use previous turn context here because we compact with the previous model &previous_turn_context, AutoCompactCallsite::PreTurnExcludingIncomingUserMessage, - // Even though incoming turn items are excluded here, this pass can be the only - // compaction run before submission. Reinject canonical context so unchanged - // model-visible instructions remain present if no follow-up pre-turn compaction - // is needed. + // User message and turn context diff is injected in the pre-compaction NotNeeded case later TurnContextReinjection::ReinjectAboveLastRealUser, None, )