You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
muse-proxy: a run that fails after producing partial output is reported as a successful 'stop' — failure is masked whenever any content exists #672
Both clauses require fullContent.length === 0. So whenever the CLI emitted any assistant text before failing, the failure is masked: the proxy returns the partial text as a normal successful completion with finish_reason: 'stop'.
Evidence (verified 2026-10-23 with a stub muse on PATH, same harness style as bin/muse-proxy.test.mjs)
Case A — terminal event says the run failed, exit code 0:
stub emits run.output.delta"partial answer", then run.terminal.failed with terminal: "failed", exit 0.
Both modes: 200 / finish_reason "stop" with the partial text, exactly as Case A.
The empty-content cases are handled correctly (#670: non-stream 500, stream SSE error frame + [DONE]); only the partial-content cases slip through.
Why it matters
Clients (opencode and any OpenAI-compatible consumer) cannot distinguish a truncated, failed run from a complete answer: they present the partial text as the model's full reply and record the request as successful. A mid-run auth expiry, rate limit, or CLI crash after the first tokens is indistinguishable from success — the worst failure shape for a bridge whose whole job is faithful translation.
New tests in bin/muse-proxy.test.mjs cover both cases above in both stream and non-stream modes (stub markers in the style of the existing FAILME/DIVERGE cases), and the existing three tests still pass (node --test bin/muse-proxy.test.mjs).
Suggested fix
Make the terminal state authoritative and drop the content-length gate, e.g.:
bin/agy-proxy.mjs:553 has a similar content-gated check (code !== 0 && !responseText). That CLI exposes no authoritative terminal event, so the semantics differ; noted here only so the fixer can decide whether it deserves its own issue — it is not part of this issue's acceptance criteria.
Activity
Merge pull request #673 from developing-today/creator/672-partial-fai…