Clamp auto-compact limit to context window (#11516)

- Clamp auto-compaction to the minimum of configured limit and 90% of
context window
- Add an e2e compact test for clamped behavior
- Update remote compact tests to account for earlier auto-compaction in
setup turns
This commit is contained in:
Ahmed Ibrahim
2026-02-11 17:41:08 -08:00
committed by GitHub
parent 6938150c5e
commit 40de788c4d
3 changed files with 70 additions and 10 deletions

View File

@@ -266,7 +266,6 @@ async fn remote_compact_trims_function_call_history_to_fit_context_window() -> R
responses::ev_shell_command_call(trimmed_call_id, trimmed_command),
responses::ev_completed("trimmed-call-response"),
]),
sse(vec![responses::ev_completed("trimmed-final-response")]),
],
)
.await;
@@ -385,10 +384,6 @@ async fn auto_remote_compact_trims_function_call_history_to_fit_context_window()
"trimmed-final-response",
500_000,
)]),
sse(vec![
responses::ev_assistant_message("post-compact-assistant", "post compact complete"),
responses::ev_completed("post-compact-final-response"),
]),
],
)
.await;