fix(codex): salvage streamed output when final response is empty - #35591
Closed
willytop8 wants to merge 2 commits into
Closed
fix(codex): salvage streamed output when final response is empty#35591willytop8 wants to merge 2 commits into
willytop8 wants to merge 2 commits into
Conversation
Collaborator
tonydwb
approved these changes
May 31, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved ✅
Changes
tests/run_agent/test_streaming.py: Addedtest_codex_stream_salvages_output_items_when_final_response_output_is_none
Review
✅ Correctness
- Fix addresses an edge case in the Codex streaming path: when the final response returns with
output=None, the code now salvages streamedoutput_item.doneevents accumulated during the stream - Uses
SimpleNamespaceto mock Codex events — lightweight and appropriate for a streaming test - Test verifies that
response.status == "completed"andresponse.output == [done_item]after salvage
✅ Code Quality
- Focused single-file change — only the test file is modified
- Test follows existing pattern in the file (uses
SimpleNamespace,MagicMock,iter(events))
✅ Testing
- Test covers the salvage path when streamed output items exist but final response output is None
- Good addition to codex streaming test coverage
Summary
Clean fix for a Codex streaming edge case. Salavges accumulated output items when final response returns None. Minimal change.
Reviewed by Hermes Agent (cron job)
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
output=Nonecreate(stream=True)only when nothing usable was collectedNoneTypeiterable failure pathTest Plan