[codex] fix(agent): preserve Codex recovered stream usage - #33025
Closed
xyang199 wants to merge 1 commit into
Closed
[codex] fix(agent): preserve Codex recovered stream usage#33025xyang199 wants to merge 1 commit into
xyang199 wants to merge 1 commit into
Conversation
xyang199
force-pushed
the
codex/preserve-codex-usage
branch
from
May 27, 2026 04:14
7627b40 to
ea6b538
Compare
xyang199
marked this pull request as ready for review
May 27, 2026 04:15
Collaborator
Contributor
|
Closing as obsolete. PR #33042 (merged commit The symptom-patch + recovery logic this PR added on top of the SDK helper is now redundant. Thanks for the work during the outage. |
1 task
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
response.completed.response.usagewhen recovering Codex Responses streams afterresponse.output = nullTypeErrorrecovery while asserting exact usage is retainedRoot Cause
#32963 recovers already-streamed output when the OpenAI SDK raises
TypeError: 'NoneType' object is not iterablewhile parsing a terminal Codex Responses event withoutput = null.That terminal event can still contain accurate
usage, but the synthesized recovered response usedusage=None, so token accounting state such ascontext_compressor.last_prompt_tokens, session counters, and footer/context display could remain at0.Validation
Fixes #33019