anomalyco / anomalyco/opencode

acp: session/new and session/prompt hang indefinitely — no timeout on MCP registration or tool calls

Open
#41,459 2 comments 0 reactions 1 assignee View on GitHub

@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
  1. Register one or more slow MCP servers in Zed's context_servers (e.g., bunx shadcn-vue@latest mcp, bunx figma-developer-mcp).
  2. Open a Zed thread with opencode as the external agent.
  3. session/new blocks for 48–66+ seconds while bunx resolves dependencies and handshakes (measured with acp-driver-*.js test scripts).
  4. Re-registration happens per session (registeredMcp is keyed by sessionId, line 966), so every new thread blocks again.
  5. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.