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 — agy-proxy: failed agy run reported as successful 'stop' — stream handler never checks the exit code, non-stream masks failure when partial output exists · Issue #678 · developing-today/code

agy-proxy: failed agy run reported as successful 'stop' — stream handler never checks the exit code, non-stream masks failure when partial output exists #678

New issue
Copy link
New issue
Copy link
Closed
#679
Closed
agy-proxy: failed agy run reported as successful 'stop' — stream handler never checks the exit code, non-stream masks failure when partial output exists#678
#679
Copy link
Assignees
dezren39
Labels
app/agy-proxybin/agy-proxy.mjs warm-session 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/agy-proxy.mjs reports a failed agy run as a successful completion in most shapes:

  • Stream mode — the child.on('close', code => ...) handler (bin/agy-proxy.mjs:467) checks code only for the resume-retry case (code !== 0 && !hasOutput && allowRetry && targetConvId, :471). Every other non-zero exit falls through to the unconditional success ending at :481-510: a chunk with finish_reason: 'stop' plus data: [DONE]. The stderrBuffer collected at :463-465 is never read anywhere in the stream path, so the failure cause is discarded entirely.
  • Non-stream mode — the failure branch is gated on empty output (if (code !== 0 && !responseText), :553), so a run that fails after producing a partial response returns HTTP 200 with finish_reason: 'stop' and the truncated text. (This is the sighting noted for separate judgement in muse-proxy: a run that fails after producing partial output is reported as a successful 'stop' — failure is masked whenever any content exists #672; the stream half above was not covered there or anywhere else.)

This is the agy-proxy counterpart of the defects already fixed in the sibling bin/muse-proxy.mjs (#670, #672, #674) and bin/codex-proxy.mjs (#676): a failed run presented as a clean stop.

Evidence (reproduced on main 4b85ef69)

Ran bin/agy-proxy.mjs with a stub agy at $HOME/.local/bin/agy (the proxy's own binary resolution) whose behaviour keys on the requested --output-format:

  • Stub prints stub agy: auth expired to stderr and exits 3, no stdout:
    • stream: HTTP 200, one chunk with finish_reason: "stop", then data: [DONE] — no error anywhere
    • non-stream: HTTP 502 {"error":"agy process exited with non-zero code","code":3,"stderr":"stub agy: auth expired"} (correct — the control case)
  • Stub emits one step_update text delta (partial answer) / {"response":"partial answer"}, prints stub agy: run failed midway to stderr, exits 3:
    • stream: HTTP 200, content chunk partial answer, then a finish_reason: "stop" chunk + [DONE]
    • non-stream: HTTP 200, content: "partial answer", finish_reason: "stop"
  • Stub success case (delta + result event / {"response":"full answer"}, exit 0) correctly returns 200 with the full text and stop in both modes.

Dedup: searches for "agy-proxy" / "agy" across open and closed issues return only #434/#435/#437/#483/#661/#672 — #672 notes the non-stream gate at :553 as "judge separately" and explicitly excludes it from its acceptance criteria; none covers the stream handler or failure detection in this proxy. Cross-repo: bin/agy-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 agy run (expired auth, CLI crash, model rejection) 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. The two modes also disagree with each other — and with the proxy's own correct empty-output non-stream case (502 with stderr).

Acceptance criteria

  • A child that exits non-zero (or is killed by a signal — code is null then) is reported as a failure in both modes, regardless of how much content was already produced: non-stream returns an error status (the existing 502 shape, with stderr, is fine) instead of 200/stop; stream mode emits a data:-framed error event naming the failure (last stderr line when present) followed by data: [DONE], and no chunk claims finish_reason: "stop".
  • The resume-retry behaviour is preserved: a failed resume (code !== 0, no output, a conversation was being resumed) still retries once as a fresh conversation before any failure is reported.
  • Successful runs (exit 0) are unchanged in both modes.
  • A regression test with a stub agy (fail-with-no-output and fail-after-partial-output cases, both modes — the bin/codex-proxy.test.mjs / bin/muse-proxy.test.mjs stub pattern; there is currently no bin/agy-proxy.test.mjs) passes; the existing proxy test suites still pass.

Activity

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

    Merge pull request #679 from developing-today/creator/678-agy-proxy-f…

    78b2cc6
  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 #679 — agy-proxy: report failed agy runs as errors instead of successful stop (#678) (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/agy-proxybin/agy-proxy.mjs warm-session 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/agy-proxybin/agy-proxy.mjs warm-session 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.