Preserve Codex statusless transport errors - #100
Open
mulfyx wants to merge 1 commit into
Open
Conversation
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
detailvalues for statusful upstream responsesProblem
Codex HTTP body failures use status
0, a descriptivemessage, and an internaldetaildiscriminator such ashttp_response_body. The shared error mapper preferreddetailwhenever it was present, so Claude Code received:instead of the actionable transport message. This is especially confusing after partial output, where replay is intentionally disabled to avoid duplicating text or tool side effects.
Fix
For statusless errors, always surface
CodexError.message. Preserve the existingdetail-first behavior for statusful upstream errors.The regression test serves a deliberately truncated HTTP response after a valid text delta and verifies that:
event: errorhttp_response_bodydiscriminator is not exposed as the user-facing messageThis follows the same post-commit boundary used by CLIProxyAPI: retry is allowed only before the first deliverable payload; after partial output, the stream is terminated with an error rather than replayed (bootstrap handler, post-payload regression test). Codex itself also treats a stream ending before
response.completedas an incomplete attempt (Codex regression test).Verification
cargo fmt --checkcargo test --offline --all-targetscargo clippy --offline --all-targets -- -D warningsAll checks pass on the current
mainbase (v0.1.32).