Skip to content

ACP: opencode acp stays alive after its private server dies and every request fails with a generic -32603 #51716

Description

@zeroliu

Description

In 2.0.3, opencode acp runs its own private opencode serve --stdio --port 0 child. If that child dies, the acp process keeps running and answers every later request with the same generic error:

{"code":-32603,"message":"Internal error: Internal service failure","data":{"errorName":"ClientError"}}

session/new, session/prompt, and session/list all fail this way until the client restarts opencode acp. The ACP process never exits, so a client that restarts the agent when its process exits never notices.

The error also can't be told apart from an ordinary request failure. On a healthy service, session/new with a cwd that does not exist returns exactly the same code, message, and data. That leaves clients two options: parse the message text, or send a second request to check whether the service is still alive.

Either of these would let clients recover cleanly:

  1. Exit opencode acp (non-zero) when its private service exits, or restart the service in place.
  2. Return a distinct error for "the service is unreachable", for example a separate data.errorName or data.service value.

Plugins

None

OpenCode version

2.0.3, driven over ACP (opencode acp) on stdio.

Steps to reproduce

  1. Start opencode acp, then send initialize and session/new. Both succeed.
  2. Find the child with pgrep -P <acp pid> (opencode serve --stdio --port 0) and kill -9 it.
  3. The acp process stays alive. Send session/new, session/prompt, or session/list: each returns the error above.
  4. For comparison, on a fresh healthy process, send session/new with cwd: "/does/not/exist". The response is the same error. A session/list sent right afterwards succeeds.

Screenshot and/or share link

N/A (JSON-RPC responses above)

Operating System

macOS 26 (Darwin 25.6.0), arm64

Terminal

N/A (ACP over stdio)

Activity

  1. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions