Skip to content

feat(process): support inherited file descriptors and exitStatus - #10884

Open
effect-bot wants to merge 34 commits into
v4/next-minorfrom
agent/effect-bot/aa78756d61d6
Open

effect-bot wants to merge 34 commits into
v4/next-minorfrom
agent/effect-bot/aa78756d61d6

Conversation

@effect-bot

Copy link
Copy Markdown
Contributor

Summary

  • Support passing existing caller-owned numeric file descriptors directly to ChildProcess via stdin, stdout, stderr, and additionalFds.
    • CommandInput, CommandOutput, and AdditionalFdConfig now accept number.
    • NodeChildProcessSpawner (and BunChildProcessSpawner, which re-exports it) validates that numeric descriptors are non-negative integers (failing with BadArgument otherwise), passes them through in stdio, treats those slots like "inherit" on the handle (Sink.drain / Stream.empty, omitted from all), and never closes caller-owned descriptors.
    • DenoChildProcessSpawner rejects numeric file descriptors with BadArgument via unsupported.
  • Add structured termination status ExitStatus ({ _tag: "Exited"; code: ExitCode } | { _tag: "Signaled"; signal: Signal }) and required ChildProcessHandle.exitStatus across Node, Bun, and Deno spawners, deriving exitCode from exitStatus so the two cannot drift apart.
  • Update existing ChildProcessSpawner.makeHandle test mocks and add a minor changeset documenting the new exitStatus handle member.

Verification

  • pnpm vitest run packages/effect/test/process/ChildProcess.test.ts packages/platform/node-shared/test/NodeChildProcessSpawner.test.ts (146/146 passed)
  • bun node_modules/vitest/vitest.mjs run packages/platform/bun/test/BunChildProcessSpawner.test.ts (6/6 passed)
  • deno run -A node_modules/vitest/vitest.mjs run packages/platform/deno/test/DenoChildProcessSpawner.test.ts (78 passed, 14 skipped)
  • pnpm vitest run --config vitest.docs.ts packages/effect/src/process/ChildProcess.ts packages/effect/src/process/ChildProcessSpawner.ts (9/9 passed)
  • pnpm vitest run packages/effect/test/ai/McpClient.test.ts packages/tools/api-diff/test/Worktrees.test.ts packages/tools/docgen/test/Core.test.ts (74/74 passed)
  • pnpm check-tsc, deno check ., oxlint, pnpm jsdocs --check, pnpm circular, pnpm ai-docgen

Closes #10842
Closes EFF-4163

effect-bot and others added 26 commits November 24, 2026 00:20
…00 (#10130)

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Effect Bot <[email protected]>
Co-authored-by: Tim <[email protected]>
@changeset-bot

changeset-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 688c4e1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 40 packages
Name Type
effect Minor
@effect/platform-node-shared Minor
@effect/platform-deno Minor
@effect/platform-bun Minor
@effect/platform-node Minor
@effect/opentelemetry Minor
@effect/vitest Minor
@effect/ai-amazon-bedrock Minor
@effect/ai-anthropic Minor
@effect/ai-cloudflare Minor
@effect/ai-openai-compat Minor
@effect/ai-openai Minor
@effect/ai-openrouter Minor
@effect/ai-typesafe Minor
@effect/atom-react Minor
@effect/atom-solid Minor
@effect/atom-vue Minor
@effect/chat-discord Minor
@effect/chat-slack Minor
@effect/chat-teams Minor
@effect/chat-telegram Minor
@effect/chat-whatsapp Minor
@effect/platform-browser Minor
@effect/platform-cloudflare Minor
@effect/sql-clickhouse Minor
@effect/sql-d1 Minor
@effect/sql-libsql Minor
@effect/sql-mssql Minor
@effect/sql-mysql2 Minor
@effect/sql-pg Minor
@effect/sql-pglite Minor
@effect/sql-sqlite-bun Minor
@effect/sql-sqlite-do Minor
@effect/sql-sqlite-node Minor
@effect/sql-sqlite-react-native Minor
@effect/sql-sqlite-wasm Minor
@effect/docgen Minor
@effect/doctest Minor
@effect/graphql-generator Minor
@effect/openapi-generator Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@effect-bot
effect-bot changed the base branch from main to v4/next-minor November 24, 2026 03:20
@effect-janitor effect-janitor Bot added the 4.0 label Nov 24, 2026
@effect-janitor effect-janitor Bot removed the 4.0 label Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Bundle Size Analysis

Generated from PR build output; treat the content below as untrusted.

File Name Current Size Previous Size Difference
arbitrary-combinators.ts 40.27 KB 40.27 KB 0.00 KB (0.00%)
basic.ts 7.35 KB 7.35 KB 0.00 KB (0.00%)
batching.ts 11.38 KB 11.38 KB 0.00 KB (0.00%)
brand.ts 7.05 KB 7.05 KB 0.00 KB (0.00%)
cache.ts 11.85 KB 11.85 KB 0.00 KB (0.00%)
config.ts 23.28 KB 23.28 KB 0.00 KB (0.00%)
differ.ts 22.39 KB 22.39 KB 0.00 KB (0.00%)
http-client.ts 28.13 KB 28.13 KB 0.00 KB (0.00%)
http-router.ts 38.75 KB 38.75 KB 0.00 KB (0.00%)
logger.ts 12.29 KB 12.29 KB 0.00 KB (0.00%)
metric.ts 9.75 KB 9.75 KB 0.00 KB (0.00%)
optic.ts 7.28 KB 7.28 KB 0.00 KB (0.00%)
pubsub.ts 16.36 KB 16.36 KB 0.00 KB (0.00%)
queue.ts 13.25 KB 13.25 KB 0.00 KB (0.00%)
schedule.ts 12.08 KB 12.08 KB 0.00 KB (0.00%)
schema-bigdecimal.ts 14.40 KB 14.40 KB 0.00 KB (0.00%)
schema-binary.ts 43.02 KB 43.02 KB 0.00 KB (0.00%)
schema-class.ts 22.11 KB 22.11 KB 0.00 KB (0.00%)
schema-codegen.ts 30.89 KB 30.89 KB 0.00 KB (0.00%)
schema-fromJsonSchemaDocument.ts 30.75 KB 30.75 KB 0.00 KB (0.00%)
schema-representation-roundtrip.ts 28.43 KB 28.43 KB 0.00 KB (0.00%)
schema-string-transformation.ts 15.70 KB 15.70 KB 0.00 KB (0.00%)
schema-string.ts 12.59 KB 12.59 KB 0.00 KB (0.00%)
schema-template-literal.ts 16.59 KB 16.59 KB 0.00 KB (0.00%)
schema-toArbitrary.ts 39.84 KB 39.84 KB 0.00 KB (0.00%)
schema-toCodecJson.ts 21.30 KB 21.30 KB 0.00 KB (0.00%)
schema-toEquivalence.ts 21.45 KB 21.45 KB 0.00 KB (0.00%)
schema-toFormatter.ts 21.55 KB 21.55 KB 0.00 KB (0.00%)
schema-toJsonSchemaDocument.ts 26.59 KB 26.59 KB 0.00 KB (0.00%)
schema-toRepresentation.ts 21.63 KB 21.63 KB 0.00 KB (0.00%)
schema.ts 21.24 KB 21.24 KB 0.00 KB (0.00%)
stm.ts 14.58 KB 14.58 KB 0.00 KB (0.00%)
stream.ts 10.70 KB 10.70 KB 0.00 KB (0.00%)
supervisor.ts 11.63 KB 11.63 KB 0.00 KB (0.00%)

effect-bot and others added 8 commits November 24, 2026 03:52
- Validate caller descriptors on the built stdio array instead of
  re-walking each config, and share the NUL-character error block.
- Collapse the stdin/stdout/stderr option resolvers to the one case
  that differs (a config object) in the Node and Deno spawners.
- Fold killProcess into a single Effect.try.
- Drop redundant ExitStatus annotations.
- Describe descriptor ownership once per type instead of repeating it
  on every stream option, and show the configs directly in the
  additionalFds example.
- Share the temp descriptor setup in the inherited descriptor tests.
@effect-bot
effect-bot force-pushed the agent/effect-bot/aa78756d61d6 branch from 5e50df8 to 688c4e1 Compare November 24, 2026 03:56
@effect-bot
effect-bot force-pushed the v4/next-minor branch 9 times, most recently from 821e1a0 to 667e2d9 Compare November 25, 2026 00:55

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

process: pass existing file descriptors to a child, and expose its terminating signal

10 participants