René's URL Explorer Experiment


Title: 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 · Issue #680 · developing-today/code · GitHub

Open Graph Title: 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 · Issue #680 · developing-today/code

X Title: 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 · Issue #680 · developing-today/code

Description: Finding PR #677 fixed bin/codex-proxy.mjs judging failure only by the child's exit code (code !== 0 in the close handler, bin/codex-proxy.mjs:412 on main 4b85ef69). But codex exec --json also reports failure in-band: it emits a {"type":"...

Open Graph Description: Finding PR #677 fixed bin/codex-proxy.mjs judging failure only by the child's exit code (code !== 0 in the close handler, bin/codex-proxy.mjs:412 on main 4b85ef69). But codex exec --json also repor...

X Description: Finding PR #677 fixed bin/codex-proxy.mjs judging failure only by the child's exit code (code !== 0 in the close handler, bin/codex-proxy.mjs:412 on main 4b85ef69). But codex exec --json also r...

Opengraph URL: https://github.com/developing-today/code/issues/680

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"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","articleBody":"## Finding\n\nPR #677 fixed `bin/codex-proxy.mjs` judging failure **only by the child's exit code** (`code !== 0` in the `close` handler, `bin/codex-proxy.mjs:412` on main `4b85ef69`). But `codex exec --json` also reports failure **in-band**: it emits a `{\"type\":\"turn.failed\",\"error\":{\"message\": …}}` event for a fatal error during a turn, and that event can arrive on a run that **exits 0**. The proxy's event parser (`processJsonLine`, `bin/codex-proxy.mjs:340-380`) handles only `item.completed` and `turn.completed` — `turn.failed` is silently ignored, so an exit-0 failed turn is still reported as a successful `stop`:\n\n- no output before the failure → HTTP 200, empty content, `finish_reason: \"stop\"` (non-stream) / a bare `stop` chunk + `[DONE]` (stream)\n- partial output before the failure → HTTP 200 carrying the truncated text as a clean `stop` (both modes)\n\nThat is exactly the masked-failure shape #676 fixed for the exit-code half — and exactly the shape `bin/muse-proxy.mjs` already guards against by judging failure from the run's authoritative terminal event first and the exit code second (`failed = terminalState ? terminalState !== 'completed' : code !== 0`, the #672/#673 pattern PR #677's body says it mirrors). The codex half of that pattern — the event-state half — is missing.\n\nExit 0 does not rule out a failed turn for codex: other codex providers explicitly check for turn-failure events on exit 0 (e.g. the codex-cli AI SDK provider's exit-code logic: \"0 | Success | Check for turn failure events; return results if none\", with a dedicated event-based error-detection pass for \"failures that may not manifest as non-zero exit codes\"), and headless-codex guidance is to fail on a `turn.failed` event rather than trust the exit code. `turn.failed` (`TurnFailedEvent { error }`, \"on fatal error during a turn\") is part of the documented `codex exec --json` event protocol.\n\nNote on scope: top-level `{\"type\":\"error\", …}` events also exist in the protocol, but some are transient reconnect notices; this issue only requires the unambiguous `turn.failed` case. Whether to treat non-reconnect `error` events as failures is a judgement call for the implementer.\n\n## Evidence (reproduced on current main `4b85ef6906a25c1a59694c64986cb17828b6c2b6`)\n\nRan the real `bin/codex-proxy.mjs` (pristine copy from `origin/main`) with a stub `codex` at `$HOME/.local/bin/codex` (the proxy's own binary resolution):\n\n- Stub prints `{\"type\":\"turn.failed\",\"error\":{\"message\":\"stub codex: model overloaded\"}}`, exits 0:\n  - non-stream → **200**, `content: \"\"`, `finish_reason: \"stop\"`\n  - stream → **200**, one `finish_reason: \"stop\"` chunk, then `data: [DONE]` — no error anywhere\n- Stub prints an `item.completed` agent_message (`partial answer`), then `{\"type\":\"turn.failed\",\"error\":{\"message\":\"stub codex: run failed midway\"}}`, exits 0:\n  - non-stream → **200**, `content: \"partial answer\"`, `finish_reason: \"stop\"`\n  - stream → **200**, the `partial answer` chunk, then a `finish_reason: \"stop\"` chunk + `[DONE]`\n- Control ( `item.completed` + `turn.completed`, exit 0) → 200 with the full text and `stop` in both modes, unchanged.\n- The existing suites pass on the same main: `node --test bin/codex-proxy.test.mjs bin/muse-proxy.test.mjs` → 10/10 — no existing test emits `turn.failed`.\n\nSource PR: #677 (`fix(codex-proxy): report failed codex runs as errors, not successful stops`, fixes #676, commit `a0a1b077`, merge `4b85ef69`). Its failure predicate is the single line `if (code !== 0)` at `bin/codex-proxy.mjs:412`; nothing in the PR's new `bin/codex-proxy.test.mjs` covers an in-band failure event.\n\nDedup: searches for `turn.failed` across all issues (open + closed) return nothing; `codex-proxy failed` returns only #676 (closed, the exit-code half), #670 (muse-proxy streaming), #496 and the open #678 (agy-proxy's separate exit-code masking — a different proxy and a different mechanism; this finding is codex-only). The `bin/codex-proxy.mjs` bridge exists only in this repo.\n\n## Why it matters\n\nClients of the proxy (opencode's codex provider) cannot distinguish a failed codex turn from a successful empty or short answer: a rate-limited, overloaded, or otherwise fatally failed turn presents as a clean `stop`, so callers accept truncated/empty output instead of surfacing an error or retrying — the same silent-corruption failure mode #670/#672/#676 were filed and fixed for.\n\n## Acceptance criteria\n\n- [ ] `bin/codex-proxy.mjs` tracks a `turn.failed` event during the run; on `close`, a run that emitted `turn.failed` is reported as a failure even when the exit code is 0: non-stream returns HTTP 500 with `Codex execution failed: \u003cthe turn.failed error message>` (falling back to stderr/signal/exit-code detail when the event carries no message), and stream mode writes a `data:`-framed error event + `data: [DONE]` with no chunk claiming `finish_reason: \"stop\"` — mirroring the existing #677 error framing.\n- [ ] Partial output followed by `turn.failed` + exit 0 is an error in both modes, not a 200 `stop` carrying the truncated text.\n- [ ] Successful runs (exit 0, `turn.completed`, no `turn.failed`) are unchanged in both modes.\n- [ ] New stub modes in `bin/codex-proxy.test.mjs` pin the no-output and partial-output `turn.failed` + exit-0 shapes in both modes; ablating only the `turn.failed` check fails exactly those new tests, and the full codex-proxy + muse-proxy + proxy-port suites pass.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-23T18:42:06Z","url":"https://github.com/developing-today/code/issues/680"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:20ff9dda-adbf-2d59-8b1f-7a7a9270b13b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD80E:23E430:AA55AE:DC22B9:6B06373F
html-safe-noncede080a33097cda64c97a26819dc635477400b5cd9066d84a8b2194af94ffccf9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODBFOjIzRTQzMDpBQTU1QUU6REMyMkI5OjZCMDYzNzNGIiwidmlzaXRvcl9pZCI6IjcyMTI5Mjk2OTc4NTA0Njg0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac36c79f5e71cd42c6ffd9b40767bd75c01b5bcfc40e03fee710fe70d9fd83895f
hovercard-subject-tagissue:6003542310
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/680/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4eb5e8d060b877f03967649c1d76234eb02e5256d2994393441126c79b17c76b/developing-today/code/issues/680
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4eb5e8d060b877f03967649c1d76234eb02e5256d2994393441126c79b17c76b/developing-today/code/issues/680
og:image:altFinding PR #677 fixed bin/codex-proxy.mjs judging failure only by the child's exit code (code !== 0 in the close handler, bin/codex-proxy.mjs:412 on main 4b85ef69). But codex exec --json also repor...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedezren39
hostnamegithub.com
expected-hostnamegithub.com
Nonec3584c853cd39700ecff6e2cf8364295ffdb5313e571046c41cd2479270f7df0
turbo-cache-controlno-preview
go-importgithub.com/developing-today/code git https://github.com/developing-today/code.git
octolytics-dimension-user_id26439447
octolytics-dimension-user_logindeveloping-today
octolytics-dimension-repository_id627308783
octolytics-dimension-repository_nwodeveloping-today/code
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id627308783
octolytics-dimension-repository_network_root_nwodeveloping-today/code
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9eb3bb1597d09170a5f282cd38ae376dee1a5ec1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/developing-today/code/issues/680#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F680
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F680
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=developing-today%2Fcode
Reloadhttps://github.com/developing-today/code/issues/680
Reloadhttps://github.com/developing-today/code/issues/680
Reloadhttps://github.com/developing-today/code/issues/680
developing-todayhttps://github.com/developing-today
codehttps://github.com/developing-today/code
Codehttps://github.com/developing-today/code
Issues1.1k (1.1k)https://github.com/developing-today/code/issues
Pull requests159 (159)https://github.com/developing-today/code/pulls
Discussionshttps://github.com/developing-today/code/discussions
Actionshttps://github.com/developing-today/code/actions
Projectshttps://github.com/developing-today/code/projects
Wikihttps://github.com/developing-today/code/wiki
Security and qualityhttps://github.com/developing-today/code/security
Insightshttps://github.com/developing-today/code/insights
https://github.com/developing-today/code
New issuehttps://github.com/login?return_to=https://github.com/developing-today/code/issues/680
New issuehttps://github.com/login?return_to=https://github.com/developing-today/code/issues/680
#693https://github.com/developing-today/code/pull/693
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 checkhttps://github.com/developing-today/code/issues/680#top
#693https://github.com/developing-today/code/pull/693
https://github.com/dezren39
https://github.com/dezren39
dezren39https://github.com/dezren39
on Oct 23, 2026https://github.com/developing-today/code/issues/680#issue-6003542310
#677https://github.com/developing-today/code/pull/677
#676https://github.com/developing-today/code/issues/676
#672https://github.com/developing-today/code/issues/672
#673https://github.com/developing-today/code/pull/673
#677https://github.com/developing-today/code/pull/677
#677https://github.com/developing-today/code/pull/677
#676https://github.com/developing-today/code/issues/676
#676https://github.com/developing-today/code/issues/676
#670https://github.com/developing-today/code/issues/670
#496https://github.com/developing-today/code/issues/496
#678https://github.com/developing-today/code/issues/678
#670https://github.com/developing-today/code/issues/670
#672https://github.com/developing-today/code/issues/672
#676https://github.com/developing-today/code/issues/676
fix(codex-proxy): report failed codex runs as errors, not successful stops #677https://github.com/developing-today/code/pull/677
github-actionshttps://github.com/apps/github-actions
dezren39https://github.com/dezren39
on Oct 23, 2026https://github.com/developing-today/code/issues/680#event-34081578021
dezren39https://github.com/dezren39
completedhttps://github.com/developing-today/code/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#693https://github.com/developing-today/code/pull/693
on Oct 23, 2026https://github.com/developing-today/code/issues/680#event-34095228487
https://github.com/apps/developing-today-fleet
developing-today-fleethttps://github.com/apps/developing-today-fleet
on Nov 24, 2026https://github.com/developing-today/code/issues/680#issuecomment-7124557425
developing.today fleethttps://kaneo.security.cab
PR #693 — fix(codex-proxy): report turn.failed events as errors, not successful stopshttps://github.com/developing-today/code/pull/693
Sign up for freehttps://github.com/signup?return_to=https://github.com/developing-today/code/issues/680
Sign in to commenthttps://github.com/login?return_to=https://github.com/developing-today/code/issues/680
dezren39https://github.com/dezren39
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.