anomalyco / anomalyco/opencode
v2 service crash-loops on EPIPE when a local MCP command dies instantly
@nexxeln is already working on this.
Since Aug 18, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
If a local MCP server in config points at a command that exits immediately (in my case a bun run --cwd <dir that no longer exists> start entry), the v2 background service crashes on startup with an uncaught EPIPE: broken pipe, send. The client keeps respawning it, so the TUI is stuck showing "restarting service" forever and v2 is unusable until the MCP entry is removed by hand.
The EPIPE comes from flushing the MCP initialize frame into the dead child's stdin. It surfaces asynchronously through the stream's destroy path after the stdin sink has already completed, so nothing is listening for the error event on proc.stdin and it takes down the whole process:
EPIPE: broken pipe, send
syscall: "send",
errno: -32,
code: "EPIPE"
at end (unknown:1:1)
at internal:fs/streams:402:23
at _destroy (internal:streams/destroy:63:18)
...
Reproduces on the Bun 1.4 runtime that the v2 binary ships with; Bun 1.3.14 doesn't surface the late EPIPE.
Plugins
No response
OpenCode version
v0.0.0-beta-17595
Steps to reproduce
- Add a local MCP server whose command dies instantly, e.g.
"command": ["bun", "run", "--cwd", "/nonexistent/dir", "start"] - Launch the v2 TUI
- Service exits 1 with the EPIPE above; TUI loops on "restarting service"
Screenshot and/or share link
No response
Operating System
macOS 26
Terminal
No response
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.