Skip to content

The agent that grows with you

feat(compression): warn on an invalid no_progress_timeout and document the key

teknium1c13d16eb35b5
diff --git a/agent/auxiliary_client.py b/agent/auxiliary_client.py
index d2309e1bc23..3c4dde5bde1 100644
--- a/agent/auxiliary_client.py
+++ b/agent/auxiliary_client.py
@@ -6152,12 +6152,20 @@ def _get_task_no_progress_timeout(task: str) -> Optional[float]:
if not task:
return None
raw = _get_auxiliary_task_config(task).get("no_progress_timeout")
- if raw is not None:
- with contextlib.suppress(ValueError, TypeError):
- value = float(raw)
- if value > 0:
- return value
- return None
+ if raw is None:
+ return None
+ try:
+ value = float(raw)
+ except (ValueError, TypeError):
+ value = 0.0
+ if isinstance(raw, bool) or value <= 0:
+ # Fail clearly: a typo here silently leaving the 60s default is exactly the
+ # "why did my 600s request abort after 60s" confusion the key exists to remove.
+ logger.warning(
+ "auxiliary.%s.no_progress_timeout=%r is not a positive number of seconds; "
+ "using the built-in %.0fs default", task, raw, _AUX_STREAM_NO_PROGRESS_TIMEOUT_SECONDS)
+ return None
+ return value
def _get_task_timeout(task: str, default: float = _DEFAULT_AUX_TIMEOUT) -> float:
diff --git a/tests/agent/test_auxiliary_client.py b/tests/agent/test_auxiliary_client.py
index f0a023a49cb..9d8b1560d2c 100644
--- a/tests/agent/test_auxiliary_client.py
+++ b/tests/agent/test_auxiliary_client.py
@@ -5009,6 +5009,61 @@ class TestNoProgressTimeoutTaskConfigGating:
assert "no_progress_timeout" not in client.chat.completions.create.call_args.kwargs
+ def test_real_config_value_reaches_the_stream_guard_per_task(self, tmp_path, monkeypatch, caplog):
+ """#108104: a REAL config.yaml ``auxiliary.compression.no_progress_timeout`` must set the
+ guard's substantive-progress window through the genuine call_llm -> _prepare_aux_request ->
+ CodexAuxiliaryClient path (both the first-output and between-output deadlines derive from
+ ``guard.no_progress_timeout``); other tasks keep the 60s default; a non-positive value
+ is rejected with a warning and falls back to the default."""
+ import yaml
+ from agent import auxiliary_client as aux
+
+ home = tmp_path / ".hermes"
+ home.mkdir()
+ monkeypatch.setenv("HERMES_HOME", str(home))
+
+ def _run(task):
+ captured = {}
+
+ class _Stop(Exception):
+ pass
+
+ def _start(self):
+ captured["window"] = self.no_progress_timeout
+ raise _Stop()
+
+ real_client = SimpleNamespace(
+ api_key="k", base_url="https://chatgpt.com/backend-api/codex/", close=lambda: None,
+ responses=SimpleNamespace(create=lambda **kw: None),
+ )
+ client = CodexAuxiliaryClient(real_client, "gpt-5.6-sol")
+ with (
+ patch.object(aux._CodexStreamGuard, "start", _start),
+ patch.object(aux, "_get_cached_client", lambda *a, **k: (client, "gpt-5.6-sol")),
+ ):
+ try:
+ call_llm(task=task, provider="openai-codex", model="gpt-5.6-sol",
+ messages=[{"role": "user", "content": "summarize"}])
+ except Exception:
+ pass
+ return captured["window"]
+
+ (home / "config.yaml").write_text(yaml.safe_dump(
+ {"auxiliary": {"compression": {"timeout": 600, "no_progress_timeout": 5}}}))
+ assert _run("compression") == 5.0
+ # Per-task: the compression override does not leak into another task (timeout 600 so the
+ # min(window, total_timeout) clamp cannot mask the default).
+ (home / "config.yaml").write_text(yaml.safe_dump(
+ {"auxiliary": {"compression": {"timeout": 600, "no_progress_timeout": 5},
+ "title_generation": {"timeout": 600}}}))
+ assert _run("title_generation") == 60.0
+
+ (home / "config.yaml").write_text(yaml.safe_dump(
+ {"auxiliary": {"compression": {"timeout": 600, "no_progress_timeout": -3}}}))
+ with caplog.at_level(logging.WARNING, logger="agent.auxiliary_client"):
+ assert _run("compression") == 60.0
+ assert any("no_progress_timeout=-3" in r.getMessage() for r in caplog.records)
+
class TestMoaAggregatorStreamingBypass:
def test_moa_aggregator_stream_bypasses_relay_for_codex_auxiliary_client(self, monkeypatch):
diff --git a/website/docs/user-guide/configuration.md b/website/docs/user-guide/configuration.md
index 39c8d6376c3..83e33ef21de 100644
--- a/website/docs/user-guide/configuration.md
+++ b/website/docs/user-guide/configuration.md
@@ -1069,6 +1069,23 @@ Points at a custom OpenAI-compatible endpoint. Uses `OPENAI_API_KEY` for auth.
| `nous` / `openrouter` / etc. | not set | Force that provider, use its auth |
| any | set | Use the custom endpoint directly (provider ignored) |
+### Stream progress timeout (Responses routes)
+
+When the summary runs over a Responses stream (the `openai-codex` provider, or any route the auxiliary client drives through the Responses API), two timeouts apply, and they are independent:
+
+- `auxiliary.compression.timeout` — the overall request budget (default 120s).
+- `auxiliary.compression.no_progress_timeout` — how long the stream may go without a **substantive** event (a text/reasoning delta or a completed output item) before the attempt aborts with `Codex auxiliary Responses stream stalled: no new output for Ns`. Default **60s** when unset. Keepalive and lifecycle frames (`response.in_progress`, pings) do not count as progress; every substantive event re-arms the window, so a slow but progressing summary is never cut off by it.
+
+Raising `timeout` alone does **not** widen the progress window — a request configured for 600s still aborts after a 60s gap. Set `no_progress_timeout` to change that gap; the effective window is capped at `timeout`, and the host's hard deadline / cancellation still win. The key is per task (`auxiliary.<task>.no_progress_timeout`), so widening it for compression does not change other auxiliary tasks. A value that is not a positive number is ignored with a warning in the log and the 60s default applies.
+
+```yaml
+auxiliary:
+ compression:
+ provider: openai-codex
+ timeout: 600
+ no_progress_timeout: 180 # tolerate a 3-minute silent gap on a long reasoning summary
+```
+
:::warning Summary model context length requirement
The summary model **must** have a context window at least as large as your main agent model's. The compressor sends the full middle section of the conversation to the summary model — if that model's context window is smaller than the main model's, the summarization call will fail with a context length error. When this happens, the middle turns are **dropped without a summary**, losing conversation context silently. If you override the model, verify its context length meets or exceeds your main model's.
:::
@@ -1488,6 +1505,8 @@ auxiliary:
# Context compression timeout (separate from compression.* config)
compression:
timeout: 120 # seconds — compression summarizes long conversations, needs more time
+ # no_progress_timeout: 60 # Responses-stream routes (openai-codex) only: seconds a summary stream
+ # # may go without a substantive event before the attempt fails fast
# fallback_chain: # Optional — providers to try on rate-limit / connectivity failure
# - provider: nous
# model: deepseek/deepseek-chat