From 0a2d4a6eea796e9ac9a589939fa9ab452a2937ec Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Thu, 2 Jul 2026 16:59:42 +0530 Subject: [PATCH] docs(codex): clarify stale-floor docstring reflects the 10k gate The helper docstring described the typical ~15-25k gateway payload but read as if that were the trigger range; the floor actually engages above 10k tokens. Clarify the prose to match the gate. --- agent/chat_completion_helpers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agent/chat_completion_helpers.py b/agent/chat_completion_helpers.py index 4e52b914a..76ab24d48 100644 --- a/agent/chat_completion_helpers.py +++ b/agent/chat_completion_helpers.py @@ -134,7 +134,9 @@ def openai_codex_stale_timeout_floor(est_tokens: int) -> float: Gateway/Telegram sessions routinely ship ~15–25k tokens of tools + instructions before the first user message. Subscription-backed Codex can legitimately spend several minutes in backend admission/prefill at that - size; the generic 90s non-stream stale default aborts healthy calls. + size; the generic 90s non-stream stale default aborts healthy calls. The + floor engages above 10k estimated tokens so those gateway-scale payloads + are covered; smaller requests keep the generic default. """ if est_tokens > 100_000: return 1200.0