Skip to content

v2 service crash-loops on EPIPE when a local MCP command dies instantly #43257

Closed as not planned

Description

@Vic563

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

  1. Add a local MCP server whose command dies instantly, e.g. "command": ["bun", "run", "--cwd", "/nonexistent/dir", "start"]
  2. Launch the v2 TUI
  3. 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

Activity

  1. github-actions commented on Aug 18, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of or related to an existing issue. Please check:

    If you've already reviewed #33653 and confirmed this is distinct, feel free to disregard.

  2. github-actions commented on Oct 20, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions