mirror of
https://github.com/openai/codex.git
synced 2026-05-02 04:11:39 +03:00
Reinject canonical context for model-switch pre-turn compaction
This commit is contained in:
@@ -132,11 +132,20 @@ fn assert_pre_sampling_switch_compaction_requests(
|
||||
!compact_body.contains("<model_switch>"),
|
||||
"pre-sampling compact request should strip trailing model-switch update item"
|
||||
);
|
||||
let first_body = first.to_string();
|
||||
assert!(
|
||||
body_contains_text(&first_body, "<environment_context>"),
|
||||
"first request should include canonical environment context"
|
||||
);
|
||||
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"
|
||||
);
|
||||
assert!(
|
||||
body_contains_text(&follow_up_body, "<environment_context>"),
|
||||
"follow-up request should preserve canonical environment context after pre-sampling compaction"
|
||||
);
|
||||
}
|
||||
|
||||
async fn assert_compaction_uses_turn_lifecycle_id(codex: &std::sync::Arc<codex_core::CodexThread>) {
|
||||
|
||||
Reference in New Issue
Block a user