Repository navigation
fix(codex-proxy): meaningful fallback for message-less turn.failed + pin string/message-less shapes (#694) - #3183
Merged
Merged
Conversation
…pin string/message-less shapes (#694) Message-less turn.failed on an exit-0 run now reports codex turn failed (turn.failed event carried no error message) instead of the self-contradictory codex exec exited with code 0; nonzero/signal diagnostics unchanged. Tests gain INBANDSTR/INBANDNONE/INBANDOBJ stub modes covering both transports, and startProxy pins the stub via a new CODEX_PROXY_CODEX_BIN env seam so a host-installed codex cannot shadow it.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Fixes #694 (triage task 1069 confirmed on main; queue task 4597).
What
turn.failedevent carries no usable message (errorabsent,null, or{}) and the run exits 0 with no stderr, the failure detail was the self-contradictorycodex exec exited with code 0. The close handler's fallback now yieldscodex turn failed (turn.failed event carried no error message)for exactly that case (in-band failure seen + exit 0). Non-zero-exit and signal fallbacks are byte-unchanged, and a present stderr line still outranks the fallback.INBANDSTR(bare-stringerror),INBANDNONE(noerror),INBANDOBJ(error: {}), exercised on both transports via the existingassertFailurehelper, plus an explicit assertion that the message-less detail does not match /exited with code 0/.findCodexBinarynow honoursCODEX_PROXY_CODEX_BINfirst, andstartProxypins it to the test stub — a host-installed codex at/run/current-system/sw/bin/codexcan no longer shadow the stub (the same host-shadowing class as agy-proxy).Test evidence (laptop)
turn.failed→500 {"error":{"message":"Codex execution failed: codex turn failed (turn.failed event carried no error message)"}}.node --test bin/codex-proxy.test.mjs: the two new codex-proxy: PR #693's turn.failed parser accepts string and message-less error shapes that are untested — and the message-less shape reports 'exited with code 0' as the failure cause #694 tests pass; the exec-transport failure family (codex-proxy: a failed codex run is reported as a successful 'stop' — close handler ignores exit code and signal in both modes #676/codex-proxy: a turn.failed event with exit 0 is reported as a successful 'stop' — #677 judged failure by exit code only, no terminal-event check #680 tests) passes; the test(proxies): PR #2164 cached_tokens emission is unpinned for the codex CLI transport and commandcode-proxy #3114 cached-tokens test passes in isolation. Note the suite is very slow on this host (~30 s/request: every request first pays two app-server connection attempts against a socket the stub never provides, then falls back to exec) — a full-file run exceeded a 10-minute window after 9 tests (7 pass; the test(proxies): PR #2164 cached_tokens emission is unpinned for the codex CLI transport and commandcode-proxy #3114 test failed once in-suite at ~60 s but passes in isolation, consistent with the latency, and it does not touch any changed code path). CI, without the host's app-server/codex shadowing, is the authoritative full-suite run.Need help on this PR? Tag
@codesmith-botwith what you need.