fix(codex): preserve streamed output text deltas#2967
Merged
Conversation
OpenAI/Codex OAuth streams can return text through response.output_text.delta while the final response.completed payload has response.output set to null. That made PicoClaw report an empty model response even though the backend returned valid content. Accumulate streamed output_text delta events during the Codex response stream and use them as a fallback when the parsed final response has no content. Add a regression test covering the null final output case from issue sipeed#2953.
This was referenced May 30, 2026
Collaborator
|
@miruchigawa Hi thanks for the PR, pls fix lint 🙏 |
Contributor
Author
|
@afjcjsbx pls review it asap 🔥 |
lc6464
approved these changes
May 31, 2026
afjcjsbx
approved these changes
May 31, 2026
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.
📝 Description
Fixes OpenAI/Codex OAuth empty responses when the backend streams valid text through
response.output_text.deltabut sends a finalresponse.completedevent withresponse.outputset tonull.The Codex provider now accumulates streamed
output_textdelta events while reading the response stream. If the final parsed response has no content, PicoClaw falls back to the accumulated streamed text instead of reporting a false empty model response.This also adds a regression test for the issue #2953 stream shape:
response.output_text.deltacontainsOK, followed byresponse.completedwith null output.🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
Fixes #2953
📚 Technical Context (Skip for Docs)
response.output_text.deltaevents. The finalresponse.completedevent should be treated as stream completion; for Codex OAuth it may not include populatedresponse.output, so PicoClaw needs to preserve streamed deltas before parsing the final response.� Test Environment
gpt-5.3-codexissue path; local regression uses mocked Codex Responses stream)📸 Evidence (Optional)
Click to view Logs/Screenshots
☑️ Checklist