You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Large openai-codex subscription requests can spend longer than the fixed TTFB cutoff in backend admission or prompt prefill before the first SSE event is emitted. Hermes treated that as a no-first-byte stream failure and reconnected, which caused long-context Codex turns to retry even though the backend could still complete successfully (the exact pattern in CRUSADER's support-thread report).
Updates the Codex Responses watchdog policy to distinguish three cases:
small requests with no first SSE event still fail fast and reconnect
large openai-codex requests wait for backend prefill instead of being killed by the first-byte watchdog
streams that emit at least one SSE event then go idle are handled by a separate event-idle watchdog
This PR is the next layer: the watchdog now distinguishes 'backend hung' (small request, no first event) from 'backend slow on prefill' (large request, no first event yet but expected to come).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
comp/agentCore agent loop, run_agent.py, prompt builderP3Low — cosmetic, nice to haveprovider/openaiOpenAI / Codex Responses APItype/bugSomething isn't working
4 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Salvage of #33383 (@sanghyuk-seo-nexcube) onto current main.
Summary
Large
openai-codexsubscription requests can spend longer than the fixed TTFB cutoff in backend admission or prompt prefill before the first SSE event is emitted. Hermes treated that as a no-first-byte stream failure and reconnected, which caused long-context Codex turns to retry even though the backend could still complete successfully (the exact pattern in CRUSADER's support-thread report).Updates the Codex Responses watchdog policy to distinguish three cases:
How this fits the cluster
Complements (does not replace):
response.completed.output = nullcrashesresponses.stream()helper entirelyThis PR is the next layer: the watchdog now distinguishes 'backend hung' (small request, no first event) from 'backend slow on prefill' (large request, no first event yet but expected to come).
Changes
agent/chat_completion_helpers.py: three-case watchdog policytests/agent/test_codex_ttfb_watchdog.py: 8 tests covering all three policy bucketsValidation
tests/agent/test_codex_ttfb_watchdog.pyAttribution
Clean cherry-pick from @sanghyuk-seo-nexcube's #33383. AUTHOR_MAP updated in follow-up commit.