Skip to content

fix: recover Codex streams with null output - #48006

Closed
abbyheo wants to merge 1 commit into
NousResearch:mainfrom
abbyheo:fix/codex-null-output-stream-recovery
Closed

fix: recover Codex streams with null output#48006
abbyheo wants to merge 1 commit into
NousResearch:mainfrom
abbyheo:fix/codex-null-output-stream-recovery

Conversation

@abbyheo

@abbyheo abbyheo commented Jun 17, 2026

Copy link
Copy Markdown

Summary

  • Recover auxiliary text-only Codex calls when the SDK parser crashes on terminal response.output=null after streaming text deltas
  • Route main Codex stream parser TypeError for null output through the raw create(stream=True) fallback
  • Treat both null and empty output as backfillable from collected streamed output items

Test Plan

  • scripts/run_tests.sh tests/agent/test_auxiliary_client.py -q

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/openai OpenAI / Codex Responses API P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels Jun 17, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #32963 (merged 2026-05-27). The null-output recovery this PR adds is already on main: agent/codex_runtime.py assembles the final Responses payload from response.output_item.done / output_text.delta deltas and never reads the terminal response.output field, and agent/auxiliary_client.py already routes the auxiliary text-only path through the raw responses.create(stream=True) + _consume_codex_event_stream fallback (documented there as "structurally immune" to the TypeError: 'NoneType' object is not iterable drift). Both halves of this PR's scope (main stream + auxiliary client) are covered. Same canonical as the earlier closed cluster (#32890, #32915, #32918).

@alaamohanad169-ship-it

Copy link
Copy Markdown
Contributor

Note: This is NOT a duplicate of the prior closed PRs (#32963, #32890, #32915, #32918). The earlier PRs were closed because they were stale (far behind upstream main). This version has been cherry-picked onto the latest origin/main with a clean diff containing only the fix changes. No conflicts. CI green. Ready for review.

@abbyheo abbyheo closed this Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists provider/openai OpenAI / Codex Responses API type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants