Skip to content

The agent that grows with you

fix(agent): preserve scaled codex ttfb timeout

fangliquanflqaa7af52a85e0
diff --git a/agent/chat_completion_helpers.py b/agent/chat_completion_helpers.py
index 9ee0f6f9e74..9d7d29decbc 100644
--- a/agent/chat_completion_helpers.py
+++ b/agent/chat_completion_helpers.py
@@ -1177,7 +1177,10 @@ def _resolve_nonstream_watchdogs(agent, api_kwargs: dict) -> _NonStreamWatchdogs
"Set HERMES_CODEX_TTFB_STRICT=1 to keep the smaller cutoff.", ttfb_timeout, idle_default,
f"{est_tokens:,}", disable_above)
ttfb_timeout = idle_default
- ttfb_cap = env_float("HERMES_CODEX_TTFB_MAX_SECONDS", 120.0)
+ # Scaling above is the default policy for large contexts. Keep the independent maximum
+ # opt-in so its implicit default cannot undo that policy; operators may still set a finite
+ # ceiling explicitly (#91621).
+ ttfb_cap = env_float("HERMES_CODEX_TTFB_MAX_SECONDS", 0.0)
if ttfb_cap > 0 and ttfb_timeout > ttfb_cap:
logger.info("Capping openai-codex no-event TTFB timeout from %.0fs to %.0fs "
"(context=~%s tokens). Set HERMES_CODEX_TTFB_MAX_SECONDS to tune.", ttfb_timeout, ttfb_cap,