GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — codex-proxy: a failed codex run is reported as a successful 'stop' — close handler ignores exit code and signal in both modes · Issue #676 · developing-today/code

codex-proxy: a failed codex run is reported as a successful 'stop' — close handler ignores exit code and signal in both modes #676

New issue
Copy link
New issue
Copy link
Closed
#677
Closed
codex-proxy: a failed codex run is reported as a successful 'stop' — close handler ignores exit code and signal in both modes#676
#677
Copy link
Assignees
dezren39
Labels
app/codex-proxybin/codex-proxy.mjs fleet proxykind/bugSomething isn't working (prefixed form of the classic bug label)

Description

@dezren39
dezren39
opened on Oct 23, 2026
Issue body actions

Finding

bin/codex-proxy.mjs never checks whether the spawned codex exec child actually succeeded. Its child.on('close', (code, signal) => ...) handler (bin/codex-proxy.mjs:401) ignores both code and signal, does not track stderr (no stderrTail — the stderr handler at :395 only logs), and unconditionally reports success: non-stream mode returns HTTP 200 with finish_reason: "stop", and stream mode emits a finish_reason: "stop" chunk + data: [DONE].

So a run that fails — auth expired, model rejected, CLI crashed — is indistinguishable from a successful empty (or partial) reply for the identical request.

This is the codex-proxy counterpart of the two defects already fixed in the sibling bin/muse-proxy.mjs: #670 (streaming failure invisible to SSE clients) and #672 (failure masked whenever any content exists). The muse-proxy fix judged failure on close and framed stream errors as SSE; codex-proxy has no failure detection at all (noted as "a different gap, not filed" in the #670 run's backlog entry).

Evidence (reproduced on main d8bfe7c)

Ran bin/codex-proxy.mjs with a stub codex at $HOME/.local/bin/codex (the proxy's own binary resolution) that reads the prompt from stdin:

  • Stub prints stub codex: auth expired to stderr and exits 3, no stdout:
    • non-stream: HTTP 200, content: "", finish_reason: "stop", completion_tokens: 0
    • stream: HTTP 200, one chunk with finish_reason: "stop", then data: [DONE] — no error anywhere
  • Stub emits one item.completed agent_message (partial answer), prints stub codex: run failed midway to stderr, exits 3:
    • non-stream: HTTP 200, content: "partial answer", finish_reason: "stop"
    • stream: content chunk partial answer, then a finish_reason: "stop" chunk + [DONE]
  • Stub success case (agent_message + turn.completed, exit 0) correctly returns 200 with the full text in both modes.

Dedup: searches for "codex-proxy" across open/closed issues return only #434/#435/#437/#480/#483/#496/#661/#670 — none covers exit-code/failure detection. Cross-repo: bin/codex-proxy.mjs exists only in this repo (no copy in developing-today/opencode, developing-today/openchamber, dezren39/nix).

Why it matters

OpenCode consumes this bridge in streaming mode as a provider. A failed Codex run presented as a clean stop with empty or truncated text is worse than an error: downstream code and users treat it as the complete answer, and an auth expiry presents as "the model said nothing" instead of a diagnosable failure.

Acceptance criteria

  • A child that exits non-zero (or is killed by a signal) is reported as a failure in both modes, regardless of how much content was already produced: non-stream returns HTTP 500 with an error.message naming the failure (last stderr line when present, otherwise a fallback naming the signal or exit code — never code null/code -2 style artifacts); stream mode emits a data:-framed error event followed by data: [DONE] and no chunk claims finish_reason: "stop".
  • Successful runs (exit 0) are unchanged in both modes.
  • A regression test with a stub codex (fail-with-no-output and fail-after-partial-output cases, both modes) passes; the existing proxy test suites still pass.

Activity

  1. github-actions
    assigned
    dezren39
    on Oct 23, 2026
  2. dezren39
    closed this as completedin #677on Oct 23, 2026
  3. dezren39
    added a commit that references this issue on Oct 23, 2026

    fix(codex-proxy): report failed codex runs as errors, not successful …

    a0a1b07
  4. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    developing-today-fleetBot
    on Nov 24, 2026 – with developing.today fleet
    Contributor
    More actions

    AUDIT-7 Lane 2 slice 3 — closing evidence. Verified against the issue body and merged implementation PR(s):

    • PR #677 — fix(codex-proxy): report failed codex runs as errors, not successful stops (merged 2026-10-23)

    The issue had zero comments in the fresh pre-action read; this comment records the missing close evidence.

  5. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    app/codex-proxybin/codex-proxy.mjs fleet proxy
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/codex-proxybin/codex-proxy.mjs fleet proxykind/bugSomething isn't working (prefixed form of the classic bug label)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.