Skip to content

The agent that grows with you

test: keep the overflow-warning fixture's estimate inside the model window

teknium11f8db424870c
diff --git a/tests/agent/test_turn_context_overflow_warning.py b/tests/agent/test_turn_context_overflow_warning.py
index 050edff1e27..a4707398d95 100644
--- a/tests/agent/test_turn_context_overflow_warning.py
+++ b/tests/agent/test_turn_context_overflow_warning.py
@@ -93,10 +93,15 @@ def _build_warn_agent(compressor: ContextCompressor) -> _WarnAgent:
def _run_build(agent):
- """Run build_turn_context with the prologue-side effects stubbed."""
+ """Run build_turn_context with the prologue-side effects stubbed.
+
+ The estimate is over the 72k threshold but under the 96k model window: the compression
+ branch must run without tripping the over-window fail-closed (a no-progress pass on a request
+ above the window ends the turn; that path is covered by
+ ``tests/agent/test_over_window_compression_fail_closed.py``)."""
with patch("agent.auxiliary_client.set_runtime_main", lambda *a, **k: None), \
patch("agent.turn_context._should_run_preflight_estimate", return_value=True), \
- patch("agent.turn_context.estimate_request_tokens_rough", return_value=999_999):
+ patch("agent.turn_context.estimate_request_tokens_rough", return_value=80_000):
return build_turn_context(
agent=agent,
user_message="hello",