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
Avoid reading the Responses output_text convenience property unless response.output is a list.
Treat response.output is None and other non-list shapes as invalid Codex responses so the existing retry/fallback path can handle them.
Add a regression with an SDK-like output_text property that would otherwise raise TypeError: NoneType object is not iterable.
Why
The main Codex stream path now avoids the known null-output terminal event by consuming SSE events directly. This keeps the later validation fallback defensive if a malformed Response-like object still reaches it, including third-party Responses-compatible providers or future SDK shape drift.
No issue was opened because the broader null-output problem already has existing reports and fixes. This PR is intentionally narrow hardening.
Validation
pytest tests/run_agent/test_run_agent_codex_responses.py -k "empty_output or none_output"
Related to merged #32963 which already landed the canonical Codex null-output recovery. This PR adds a narrower defensive guard (checking isinstance(response.output, list) before reading output_text) as additional hardening in the validation fallback path. Complementary safety-net, not a direct duplicate — covers the same code path but with a different defensive strategy.
Thanks for this — closing as already fixed on main.
The Codex null-output crash (response.completed with output: null from the chatgpt.com backend → TypeError: 'NoneType' object is not iterable → surfaced as "non-retryable HTTP None") is resolved by commits already on main:
43a3f119f — recover Codex streams with null output.
dc9d677d5 — classify TypeError('NoneType … not iterable') as a retryable provider-shape error so retry/fallback runs instead of killing the turn.
Your fix targets the same path that's now hardened upstream, so there's nothing left to merge here. Your authorship is preserved in your branch; I'm crediting your report in the umbrella issue #33932 (now closed). Appreciate the contribution.
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
codexcomp/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointP3Low — cosmetic, nice to havetype/bugSomething isn't working
3 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.
Summary
output_textconvenience property unlessresponse.outputis a list.response.output is Noneand other non-list shapes as invalid Codex responses so the existing retry/fallback path can handle them.output_textproperty that would otherwise raiseTypeError: NoneType object is not iterable.Why
The main Codex stream path now avoids the known null-output terminal event by consuming SSE events directly. This keeps the later validation fallback defensive if a malformed Response-like object still reaches it, including third-party Responses-compatible providers or future SDK shape drift.
No issue was opened because the broader null-output problem already has existing reports and fixes. This PR is intentionally narrow hardening.
Validation
pytest tests/run_agent/test_run_agent_codex_responses.py -k "empty_output or none_output"Result: 3 passed, 65 deselected.