Skip to content

Deno subprocess stdin failures can crash or stall the host #1415

Description

@morluto

Problem

The Deno subprocess runtime writes protocol messages directly to child.stdin without observing stream error events or awaiting write completion.

If the child closes stdin before a tool-result message is written, Node can emit an unhandled EPIPE. That can terminate the host process. In environments that intercept the uncaught event, execution stalls until an outer timeout because the runtime never translates the write failure into an execution result.

Reproduction

  1. Start a Deno worker subprocess.
  2. Have the child close stdin after the initial protocol exchange.
  3. Emit a tool call so the host writes a tool-result message.

On the current base, the write emits an uncaught EPIPE. With the event intercepted for the regression harness, the execution then reaches its five-second outer timeout.

Expected behavior

  • Subprocess stdin failures do not escape as uncaught stream errors.
  • A failed initial or tool-result write disposes the child process.
  • Execution returns a failed ExecuteResult with an actionable write error.
  • Existing missing-Deno diagnostics remain unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions