anomalyco / anomalyco/opencode

Local MCP server subprocess launch (Playwright) hangs forever when hosted by Desktop, works fine from a terminal

Open
#42,191 1 comment 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Aug 13, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

A local MCP server that spawns a subprocess internally (in my case Python + Playwright, launching a Node driver + Chromium) hangs forever when the tool is called through OpenCode Desktop, but the exact same code and profile works correctly when run directly from a terminal.

When hosted by Desktop: the call that should spawn the subprocess never produces any child process at all (pgrep -P <server-pid> returns zero children for 10+ minutes) and never hits its own internal timeout, even though that timeout is a plain asyncio.wait_for. A stack sample (sample <pid>) of the hung process shows every thread idle (asyncio event loop idle, stdio reader idle) - nothing anywhere near the subprocess-launch code.

Running the identical script directly in a terminal (not through OpenCode) spawns the subprocess immediately and completes normally.

Ruled out: Gatekeeper/quarantine on the subprocess binary, macOS App Sandbox on OpenCode.app, missing binaries, broken PATH/env, zombie/reaped children.

Points to something about how Desktop hosts local MCP server processes (child of the Electron "OpenCode Helper (Utility)" process) blocking subprocess creation from within that process.

Plugins

No response

OpenCode version

1.15.13

Steps to reproduce
  1. Configure a local stdio MCP server that internally spawns a subprocess (e.g. Python asyncio.create_subprocess_exec, or Playwright's driver)
  2. Launch it through OpenCode Desktop
  3. Call the tool that spawns the subprocess
  4. Observe: no child process ever appears under the server's PID, call hangs past its own timeout
  5. Run the identical code directly from a terminal - subprocess spawns immediately, works fine
Screenshot and/or share link

No response

Operating System

macOS 26.5.2

Terminal

N/A (Desktop app)

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.