Skip to content

fix(process): reset Windows pipe stdio after completion - #82

Merged
steipete merged 1 commit into
mainfrom
w94/windows-stdio-reuse
Oct 3, 2026
Merged

steipete merged 1 commit into
mainfrom
w94/windows-stdio-reuse

Conversation

@steipete

@steipete steipete commented Oct 2, 2026 •

Copy link
Copy Markdown

On Windows pipes, process.stdout.end() or a completed pipeline left Bun's stream permanently ended. Node resets the stream and accepts later writes. The stdio _destroy override already performs that reset, but the Windows pipe branch did not enable autoDestroy, so successful completion never reached it.

Enable the existing finish/destroy/reset path for Windows pipes. POSIX retains the same auto-destroy setting, native shutdown, and EPIPE guards from #76. A native Windows regression checks stdout and stderr after both end() and pipeline completion, including writable-state flags, scalar writes, and corked vector writes.

Upstream PR/issue searches for Windows stdout end, autoDestroy, and write-after-end found no matching fix. The upstream adaptation is oven-sh#44475.

Focused native Windows proof is complete; the full matrix and rebase CI are in progress. Fork PR CI has Linux and macOS lanes and no Windows lane. An unpublished Windows dry-run build and Node 24 comparison will be recorded before landing. W86 previously reproduced the late-write failure in stock Bun and the fork, with Node passing. The new fixture is directly runnable under Node or Bun on Windows.

Native Windows evidence (Windows Server 2022, Node 24.21.0): the fixture passes all four stdout/stderr × end/pipeline combinations under Node and patched head ead040e29a, including later scalar and corked writes. The same fixture fails on W86's 6a5d9c721f baseline. The local POSIX stdio/environment suites pass 44 tests with three platform skips; 16 SHARE_ENV tests pass.

Unpublished dry run 37077930429 passed cross-build, Windows smoke, and manifest; Publish was skipped. ZIP SHA-256: 7c119385b8cd45df334f37f79928144877d9e0588aee389d023b57ef365a3e4f; executable SHA-256: ec02e7fbc7a489ef749cf455cc6b07de95a2c3f27c2b914645bd9fd3fe0ae25e. Both matched locally and on Windows. The executable is unsigned and was not published. Linux/macOS CI passed on that exact head in 37077930396. The branch has since been rebased onto the concurrent filesystem fix; the runtime diff is unchanged.

After rebasing onto the concurrent filesystem fix, Linux and macOS CI passed on exact head 5692c9e2a06b99cfb2330dfacc6e092bf74bce54: 37081195469. The refreshed branch P2 review is scoped-clean.

Final landing head d26faa938beec21092c03342304ea01b6bab3b02 is rebased onto the merged environment fix (#81). Linux/macOS CI pass in 37083514701, and the refreshed branch P2 review is scoped-clean. The local integration of all three Windows fixes passes 48 applicable focused tests (four platform skips) and 24/24 OpenClaw lazy-alias tests. The first full Windows matrix has no regressions; final combined Windows qualification proceeds with #83.

@steipete
steipete force-pushed the w94/windows-stdio-reuse branch from ead040e to 5692c9e Compare October 3, 2026 00:14
Enable autoDestroy for Windows pipe stdout/stderr so finish reaches the existing stdio _destroy reset. Preserve POSIX shutdown and EPIPE behavior. Cover later scalar and corked writes after end and pipeline on both descriptors.
@steipete
steipete force-pushed the w94/windows-stdio-reuse branch from 5692c9e to d26faa9 Compare October 3, 2026 00:47
@steipete
steipete marked this pull request as ready for review October 3, 2026 00:59
@steipete
steipete merged commit 0731292 into main Oct 3, 2026
8 checks passed
@steipete
steipete deleted the w94/windows-stdio-reuse branch October 3, 2026 00:59
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.

1 participant