Skip to content

ACP session/new always returns -32603 Internal error #25568

Description

@haoxuhong

Description

Problem

When using OpenCode via ACP (Agent Client Protocol), the initialize handshake succeeds, but session/new always returns -32603 Internal error.

Environment

  • OpenCode version: 1.14.33 (npm) and 1.14.29 (registry)
  • OS: macOS 26.3 (darwin arm64)
  • Node: v23.11.0
  • IDE: Android Studio Panda 4 | 2025.3.4
  • AI Assistant plugin: 253.32098.66

Reproduction

Command line repro:

(echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{"fs":{"readTextFile":true,"writeTextFile":true}},"clientInfo":{"name":"test","version":"0.1.0"}}}'; sleep 1; echo '{"jsonrpc":"2.0","id":2,"method":"session/new","params":{"cwd":"/Users/haoxuhong","mcpServers":[]}}'; sleep 3) | opencode acp 2>&1

Output

{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":1,...}}  <-- initialize OK
Error handling request { jsonrpc: "2.0", id: 2, method: "session/new", params: { cwd: "/Users/haoxuhong", mcpServers: [] } } { code: -32603, message: "Internal error", data: {} }
{"jsonrpc":"2.0","id":2,"error":{"code":-32603,"message":"Internal error","data":{}}}  <-- session/new FAILS

The error occurs regardless of the cwd value. Tested with home directory and multiple project directories.

Also tested with the Registry-installed version (1.14.29) via Android Studio AI Assistant plugin (253.32098.66) with identical results.

ACP Transport Log

OUT: {"method":"initialize",...}  <-- sent
IN:  {"id":1,"result":{...}}      <-- success
OUT: {"method":"session/new","params":{"cwd":"...","mcpServers":[]}}
IN:  {"id":2,"error":{"code":-32603,"message":"Internal error"}}  <-- fails

Additional Context

  • OpenCode was installed via npm install -g opencode-ai
  • Credentials are configured (OpenCode Zen, Z.AI Coding Plan, Z.AI)
  • The same issue occurs both with manual acp.json configuration and with Registry-installed agent
  • ACP initialize succeeds and returns correct capabilities, but any subsequent session/new fails

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

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