Skip to content

CLI --completion crashes on an unhandled EPIPE when its reader closes early #2646

Closed

Description

@cliffhall

Problem

Found during the v2.10.0 release smoke (#2623) and recorded in its ledger. mcp-inspector --cli --completion <shell> writes the script through awaitableLog. If the reader closes the pipe before the write finishes, Node throws an unhandled 'error' event (write EPIPE) with a stack trace. Two cases do this: | head, and bash 3.2's source <(…), where process substitution does not keep the pipe open.

Reproduce

node clients/launcher/build/index.js --cli --completion bash | head -1
# → node:events … Unhandled 'error' event … Error: write EPIPE

Expected

The completion path treats EPIPE on stdout as a normal early close and exits quietly. Other paths already do this (mcpdo's auth helper installs process.stdout.on("error", () => {})).

Priority

Low (rubric total 5): Severity 2, Urgency 1, +1 bug, +1 milestoned.

Activity

  1. added this to the v2.11.0 milestone on Oct 7, 2026
  2. added
    bugSomething isn't working
    v2Issues and PRs for v2
    on Oct 7, 2026
  3. self-assigned this
    on Oct 12, 2026
  4. cliffhall commented on Oct 12, 2026

    @cliffhall
    MemberAuthor

    Fixed by #2700, merged into v2/main.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingv2Issues and PRs for v2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions