Skip to content

Handle Deno subprocess stdin failures#1418

Open
morluto wants to merge 1 commit into
UsefulSoftwareCo:mainfrom
morluto:fix/deno-subprocess-stdin
Open

Handle Deno subprocess stdin failures#1418
morluto wants to merge 1 commit into
UsefulSoftwareCo:mainfrom
morluto:fix/deno-subprocess-stdin

Conversation

@morluto

@morluto morluto commented Jul 15, 2026

Copy link
Copy Markdown

Fixes #1415

Summary

The Deno subprocess runtime now observes and awaits stdin writes. If the child closes stdin during the initial protocol message or a tool-result write, execution returns a failed ExecuteResult instead of emitting an uncaught stream error or stalling.

Changes

  • Own the child stdin error listener for the subprocess lifetime.
  • Await write callbacks for the initial and tool-result protocol messages.
  • Wait for the child spawn before sending the initial message.
  • Dispose the child after a failed write.
  • Add a subprocess fixture that closes stdin and a public-executor regression.
  • Add an executor patch changeset.

Existing missing-Deno diagnostics remain unchanged.

Regression proof

On origin/main, the regression emits an uncaught EPIPE when the child closes stdin. When the uncaught event is intercepted by the harness, execution reaches its five-second guard without returning a result.

With this change, the same execution returns result: null with an actionable message containing Failed to write to Deno subprocess stdin: write EPIPE.

Validation

  • Focused runtime suite: 3 tests passed.
  • Fourteen real-Deno tests were skipped because Deno is not installed in the validation environment.
  • Package typecheck passed with existing Effect language-service suggestions.
  • Targeted lint, formatting, and git diff --check passed.
  • Branch autoreview against origin/main returned no actionable findings.

Limitations

The regression uses a Node subprocess fixture to deterministically exercise the shared stdin failure path without requiring a Deno installation. The existing real-Deno suite remains unchanged and was skipped by the environment.

The fixture is skipped on Windows because its subprocess signaling is POSIX-specific.

Review order

  1. The close-stdin fixture and public-executor regression.
  2. Stdin ownership and write completion in deno-worker-process.ts.
  3. Runtime wiring and release note.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deno subprocess stdin failures can crash or stall the host

1 participant