You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Session hangs indefinitely after MCP tool-call — no timeout recovery (deadlock) #35207
Occasionally an opencode session becomes permanently stuck after an MCP tool-call (most often a playwright_browser_* call) does not return. The process stays alive but is unresponsive.
Observed on a session that had been hung for ~36 minutes:
Process: alive, 35 threads, ~970 MB working set, CPU drifting near-idle (~0.1 CPU-sec/min).
TCP connections owned by the opencode PID: 5 Bound, 0 ESTABLISHED — not waiting on any LLM API response.
No bash/pwsh/cmd child process running a user command — only the MCP server children (playwright, z_ai, context7). So it is not waiting on a shell command either.
It looks like the tool-call state machine is waiting forever for an MCP response that will never arrive. /interrupt and Esc have no visible effect. Only killing the opencode.exe process from another terminal recovers it, and the session is lost.
Workaround I'm now using: disabled the Playwright MCP by default ("enabled": false) and added "timeout": 10000 to each MCP entry — but per the docs that timeout only covers the initial tool-list fetch, not runtime tool-calls, so this is only partial mitigation.
Plugins
None
OpenCode version
1.17.13
Steps to reproduce
Non-deterministic — depends on MCP server flakiness, but has happened multiple times with Playwright MCP enabled.
Start opencode with Playwright MCP enabled: true.
In a session, ask the agent to use a playwright_browser_* tool against a slow-loading or crashing page.
Occasionally the tool-call never returns (browser hang or stdio pipe stall).
The session UI shows a spinner forever; /interrupt and Esc do nothing; the conversation cannot continue.
Suggested fixes (any one would unblock users):
Add a configurable per-tool-call timeout (default e.g. 60s) in the MCP tool executor; on expiry, return a synthetic error to the LLM (tool_call timed out).
Make /interrupt actually cancel the in-flight tool-call (send cancellation to the MCP server, drop the pending response, restore the session loop).
Detect MCP child-process health (stdio EOF / heartbeat); if the child crashes or the pipe stalls, fail any pending tool-call for that server with a clear error instead of waiting forever.
Activity
github-actions commentedon Jul 3, 2026
This issue might be a duplicate of existing issues. Please check:
state.status="running"forever; assistant messagefinish: null#31235: Parallel MCP tool call staysstate.status="running"forever with no recovery — same root cause of MCP tool-calls that never complete and block the session indefinitely/interruptto cancel in-flight tool workgithub-actions commentedon Sep 2, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.