Repository navigation
Description
Description
V2 terminal ACP error conversion drops SessionError.status and retryAfterMs. A retained wire-level regression reproduces the loss for both terminal execution errors and step errors followed by a normal execution completion.
This is a V2 follow-up to #52860/#52861. Those V1 reports were closed for V1 retirement, with an invitation to report or port a relevant V2 case. This report concerns V2's normalized numeric fields, rather than forwarding V1 response headers.
Plugins
Not involved; a synthetic HTTP/SSE fixture supplies the session failure events.
OpenCode version
V2 checkout HEAD d33b5783338b8b350aafc09f7dc2701eeba52a9a. Red used the baseline error/translation files; green includes their local working-tree repair. Tests used Bun 1.4.4.
A read-only comparison on 2026-11-22 found the same baseline owning files at upstream dev commit 73a0eae88de47f10068a0f9dc7a743638fa3d830. That upstream pin was not a new test run.
Steps to reproduce
The extended regression cases are included in fork commit 327c094. The retained command was executed from packages/cli:
bun test --timeout 30000 --only-failures test/acp/error.test.ts
-
Start the test's real ACP connection against its synthetic event server. After prompt delivery, emit a terminal execution failure, or a
session.step.failedfollowed by execution success, carrying:{ "type": "provider.rate-limit", "message": "Rate limit reached", "status": 429, "retryAfterMs": 60000 } -
Inspect the JSON-RPC error received by the ACP client.
Before the repair, both cases returned an error whose data contained only:
{ "service": "session", "errorName": "provider.rate-limit" }Expected and verified after the local repair: error data also contains "status": 429 and "retryAfterMs": 60000. JSON-RPC code -32603 and message Internal error: Rate limit reached are preserved; the missing status is the provider's numeric status.
On 2026-11-22 UTC, the baseline run at 00:31:09 had 4 failed / 4 passed, exit 1: the two rate-limit cases, status-only 503, and delay-only 0 failed. The repaired run at 00:33:15 had 8 passed / 0 failed, exit 0, also covering omitted diagnostics, raw-response exclusion and the existing unavailable-server cases.
At the public pin, ACPTranslate.failure copies only message/type into ServiceFailureError, and ACPError.toRequestError serializes only service/error name. In-progress opencode/retry is a separate channel.
Screenshot
Not captured; synthetic protocol regression, without an installed UI or live provider.
Operating System
Windows; Bun 1.4.4.
Terminal
Not applicable; ACP NDJSON fixture, no TUI.
Activity
opencodejr commentedon Nov 22, 2026
Thanks for the detailed report and the regression tests in your fork.
To restate the request: when a V2 ACP prompt ends in a provider failure, you'd like the JSON-RPC error
datato include the session error's numericstatusandretryAfterMsas well asserviceanderrorName. That would let ACP clients tell a 429 apart and know when they can retry.The code matches what you describe:
ACPError.toRequestErrorputs onlyserviceanderrorNamein the error data, while the session error already carriesretryAfterMswhen it is known. The ACP docs describe retry status sent during a turn through_meta["opencode/retry"], but I didn't find anything in them saying the final error carries a status or retry delay. So I'm treating this as an improvement to the ACP error payload rather than a bug. Maintainers will consider it, though I can't promise whether or when it will land.Related issues:
opencode/retrychannel).