anomalyco / anomalyco/opencode
acp: session/new and session/prompt hang indefinitely — no timeout on MCP registration or tool calls
@kitlangton is already working on this.
Since Aug 10, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
ACP session/new blocks until every transferred MCP server finishes registering (registerMcpServers in service.ts:196), but there is no timeout — request() (service.ts:710) wraps only Effect.tryPromise. Likewise, session/prompt waits on MCP tool invocations without a deadline.
[Root cause]
Effect.timeout is never applied to the MCP registration path or tool-call path in the ACP service.
- registerMcpServers → request(() => sdk.mcp.add(...)) → no deadline (service.ts:710–722)
- session/prompt → request(() => input.sdk.session.prompt(...)) → no deadline (service.ts:507–526)
- Individual MCP registration failures are silently swallowed (Effect.ignore, ~line 1002), so a hung bunx process is never surfaced as an error — it just waits forever.
[Environment]
- Windows, opencode v1.18.15, Zed 1.14.2+stable, bun 1.3.4
- Affects macOS / Linux as well (same code path)
Plugins
No response
OpenCode version
1.18.15
Steps to reproduce
- Register one or more slow MCP servers in Zed's context_servers (e.g., bunx shadcn-vue@latest mcp, bunx figma-developer-mcp).
- Open a Zed thread with opencode as the external agent.
- session/new blocks for 48–66+ seconds while bunx resolves dependencies and handshakes (measured with acp-driver-*.js test scripts).
- Re-registration happens per session (registeredMcp is keyed by sessionId, line 966), so every new thread blocks again.
- Mid-conversation, when the LLM invokes one of those MCP tools and the server is slow/unresponsive, session/prompt hangs silently — no error, no timeout.
[first] session/new sent t=1.2s → session created t=47.8s
[second] session/new sent t=47.8s → session created t=70.6s
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
Bash
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.