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
Description
Problem
When using OpenCode via ACP (Agent Client Protocol), the
initializehandshake succeeds, butsession/newalways returns-32603 Internal error.Environment
Reproduction
Command line repro:
Output
The error occurs regardless of the
cwdvalue. 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
Additional Context
npm install -g opencode-aiacp.jsonconfiguration and with Registry-installed agentinitializesucceeds and returns correct capabilities, but any subsequentsession/newfailsPlugins
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