fix(codex): trust response.status for reasoning-only turns on unrecognized Responses backends - #64764
Merged
Merged
Conversation
…nuation path Follow-up to the salvaged #64449: the status-trusting branch flipped github_responses to 'stop' alongside unknown relays. Copilot fronts the same OpenAI model family as codex_backend and shows the same reasoning-only 'still thinking' degeneration, so it stays on the continuation path. Only unrecognized (other:*) backends trust response.status='completed' as terminal.
teknium1
force-pushed
the
fix/64434-reasoning-only-finish-reason
branch
from
July 15, 2026 04:50
ddbd9db to
7d8ce88
Compare
Collaborator
Salvage of #64449 (fixes #64434) with authorship preserved, plus a |
…ng test The #64434 change makes unrecognized issuers trust response.status='completed' for reasoning-only turns, so this sibling test (which exercised the old default-path behavior) now pins the Codex backend explicitly — the surface where reasoning-only still means 'still thinking'.
19 tasks
teknium1
added a commit
that referenced
this pull request
Jul 15, 2026
) test_normalize_codex_response_salvage_is_xai_scoped broke on main when two same-day merges crossed: #64764 (#64434 — trust response.status for reasoning-only turns on UNRECOGNIZED Responses backends) changed what a bare _normalize_codex_response(response) call returns for status='completed' reasoning-only output (now 'stop'), while #64768 added this test calling with no issuer_kind and expecting 'incomplete'. The test's intent is that the xAI reasoning-channel salvage does not leak into other special-cased backends — pin issuer_kind='codex_backend' so it exercises exactly that (same pattern as test_normalize_codex_response_treats_summary_only_reasoning_as_incomplete, which was already pinned for #64434).
1 task
13 tasks
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…sResearch#64844) test_normalize_codex_response_salvage_is_xai_scoped broke on main when two same-day merges crossed: NousResearch#64764 (NousResearch#64434 — trust response.status for reasoning-only turns on UNRECOGNIZED Responses backends) changed what a bare _normalize_codex_response(response) call returns for status='completed' reasoning-only output (now 'stop'), while NousResearch#64768 added this test calling with no issuer_kind and expecting 'incomplete'. The test's intent is that the xAI reasoning-channel salvage does not leak into other special-cased backends — pin issuer_kind='codex_backend' so it exercises exactly that (same pattern as test_normalize_codex_response_treats_summary_only_reasoning_as_incomplete, which was already pinned for NousResearch#64434).
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
…sResearch#64844) test_normalize_codex_response_salvage_is_xai_scoped broke on main when two same-day merges crossed: NousResearch#64764 (NousResearch#64434 — trust response.status for reasoning-only turns on UNRECOGNIZED Responses backends) changed what a bare _normalize_codex_response(response) call returns for status='completed' reasoning-only output (now 'stop'), while NousResearch#64768 added this test calling with no issuer_kind and expecting 'incomplete'. The test's intent is that the xAI reasoning-channel salvage does not leak into other special-cased backends — pin issuer_kind='codex_backend' so it exercises exactly that (same pattern as test_normalize_codex_response_treats_summary_only_reasoning_as_incomplete, which was already pinned for NousResearch#64434).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Reasoning-only completed turns on
api_mode: codex_responsesno longer get force-classified asincompletefor unrecognized Responses backends — the provider's ownresponse.status="completed"is trusted, eliminating ~12-minute silent continuation stalls (3 retries × up to 240s stale timeout each).Salvages #64449 (@webtecnica, fixes #64434) with authorship preserved, plus one follow-up.
Root cause:
_normalize_codex_responseinferred "still thinking" purely from item-type composition (only areasoningitem present). That heuristic is correct for Codex/xAI backends where reasoning-only is a documented degeneration mode, but wrong for generic Responses-compatible relays (other:<base_url>), where a completed reasoning-only turn is a valid final state. The misfire drove the continuation path repeatedly and could burn the whole 150-iteration budget while showing only "Working — N min".Changes
agent/codex_responses_adapter.py: whenresponse.status == "completed", only the specially-handled backends (codex_backend,xai_responses,github_responses) keep the reasoning-only →incompletecontinuation heuristic; all other issuers getstop(@webtecnica)github_responsesto the continuation set — the contributor's diff silently flipped Copilot to thestopside, but Copilot fronts the same OpenAI model family ascodex_backendand shows the same reasoning-only degeneration; plus a pinning testValidation
other:<relay>codex_backendxai_responsesgithub_responsesother:<relay>status=in_progressscripts/run_tests.sh tests/run_agent/test_run_agent_codex_responses.py: 90/90 passedInfographic