Skip to content

[BUG] ACP session/new fails with 'Internal error: OpenCode service failure' on Linux (WSL) #31091

@SXongin

Description

@SXongin

Description

opencode acp (both v1.16.2 and beta 0.0.0-beta-202606060810) returns -32603 Internal error: OpenCode service failure for session/new requests on Linux (WSL/Arch Linux). The initialize handshake works correctly, but any session/new call fails with service: "directory" in the error data.

The same project directory works perfectly in opencode run mode — the bug is specific to the ACP codepath.

Environment

  • OS: Arch Linux under WSL (Windows 11 host)
  • opencode versions tested: 1.16.2, 0.0.0-beta-202606060810
  • User: root
  • Project directory: /root/workspace/dev/praxis (has valid opencode.json with deepseek + xiaomi-token-plan-cn providers)

Steps to Reproduce

cd /root/workspace/dev/praxis
(printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1,"clientInfo":{"name":"test","version":"1.0"}}}\n'
 printf '{"jsonrpc":"2.0","id":2,"method":"session/new","params":{"cwd":"/root/workspace/dev/praxis","mcpServers":[]}}\n'
 sleep 3) | timeout 12 opencode acp --print-logs

Expected Behavior

session/new should return a session ID.

Actual Behavior

Initialize: ✓ (returns protocolVersion, capabilities, agentInfo)
session/new: ✗ {"code":-32603,"message":"Internal error: OpenCode service failure","data":{"service":"directory"}}

Additional Context

  • opencode run in the same project directory works correctly (providers load: deepseek, xiaomi-token-plan-cn, opencode)
  • No OPENCODE_SERVER_PASSWORD environment variable set (session/new returns "Internal error" on Windows via ACP #17285 fix does not help)
  • The underlying error is swallowed by fromUnknownError() in acp/error.ts — no stack trace or root cause visible even with --log-level DEBUG
  • The loadDirectorySnapshot() function makes 5 parallel SDK calls (config.providers, app.agents, command.list, app.skills, config.get) — any of these could be failing silently

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions