Skip to content

acp: terminal errors omit V2 provider status and retry delay #65520

Description

@chirag127

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
  1. Start the test's real ACP connection against its synthetic event server. After prompt delivery, emit a terminal execution failure, or a session.step.failed followed by execution success, carrying:

    {
      "type": "provider.rate-limit",
      "message": "Rate limit reached",
      "status": 429,
      "retryAfterMs": 60000
    }
  2. 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

  1. opencodejr commented on Nov 22, 2026

    @opencodejr
    Contributor

    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 data to include the session error's numeric status and retryAfterMs as well as service and errorName. That would let ACP clients tell a 429 apart and know when they can retry.

    The code matches what you describe: ACPError.toRequestError puts only service and errorName in the error data, while the session error already carries retryAfterMs when 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:

  2. added
    area/ide-acp
    type/feature
    version/v2
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ide-acpplatform/windowstype/featureversion/v2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions