Handle model-switch base instructions after compaction (#11659)

Strip trailing <model_switch> during model-switch compaction request,
and append <model_switch> after model switch compaction
This commit is contained in:
Charley Cunningham
2026-02-13 19:02:53 -08:00
committed by GitHub
parent 8156c57234
commit 67e577da53
4 changed files with 174 additions and 0 deletions

View File

@@ -142,6 +142,15 @@ fn assert_pre_sampling_switch_compaction_requests(
body_contains_text(&compact_body, SUMMARIZATION_PROMPT),
"pre-sampling compact request should include summarization prompt"
);
assert!(
!compact_body.contains("<model_switch>"),
"pre-sampling compact request should strip trailing model-switch update item"
);
let follow_up_body = follow_up.to_string();
assert!(
follow_up_body.contains("<model_switch>"),
"follow-up request after successful model-switch compaction should include model-switch update item"
);
}
async fn assert_compaction_uses_turn_lifecycle_id(codex: &std::sync::Arc<codex_core::CodexThread>) {