fix(codex): monkey-patch openai SDK parse_response to handle output=None - #55797
fix(codex): monkey-patch openai SDK parse_response to handle output=None#55797nicha16 wants to merge 1 commit into
Conversation
Codex backend can return responses with output=None. OpenAI SDK 2.32.0 crashes in parse_response (for output in response.output) before Hermes sees the response. Coerce None to empty list via a Hermes-side import-time monkey-patch. Verified with direct streaming smoke test against Codex. (cherry picked from commit a00dd04cc0e1b722a655fba835febd737a835f82)
Duplicate of #32963 (merged 2026-05-27, "recover Codex Responses streams with null output"). That fix — plus the structural refactor in #33042 — already handles the Codex |
|
Closing as redundant against current The Codex Responses Thanks for the fix — the approach was sound; the code path it patched just no longer exists on main. |
The OpenAI SDK's
parse_responsecan returnNonefor certain edge cases (non-recoverable stream errors, cancellation mid-parse). Without handling, this propagates asAttributeError: 'NoneType' object has no attribute 'model_dump'.Adds a monkey-patch in
codex_responses_adapter.pythat wrapsparse_responseto return an empty completion instead ofNone.