Skip to content

fix(process): port IPC and buffered-stdio compatibility fixes - #37

Merged
steipete merged 6 commits into
mainfrom
claude/port-ci-deferred
Sep 30, 2026
Merged

steipete merged 6 commits into
mainfrom
claude/port-ci-deferred

Conversation

@steipete

Copy link
Copy Markdown

Port the CI-line IPC channel reference, writable stdio assignment, failed-spawn exit-code, and buffered FileSink completion fixes after #28 landed. Preserve #28’s parent-end descriptor and stream._handle ownership and the upstream _final flush while completing per-write callbacks through Writable’s normal queue, cork, drain, and error lifecycle.

These repair OpenClaw’s spawn-broker channel ref/unref calls and subprocess adapters, and ensure pipe-write callbacks report completion or failure correctly. Upstream oven-sh#43879 covers final flushing only; its existing implementation is retained while porting the missing per-write completion behavior.

Original authors and cherry-pick provenance are retained as individual commits.

CI source Fork commit Fix Upstream PR/state
73342fd16f e4df875557 fix(node:child_process): support IPC channel references #36405 OPEN
64b2c253fc ff29674630 fix(child_process): allow stdio assignment before access #43008 OPEN
9a2d874b65 2c5411aa0d fix(child_process): record failed spawn exit code #43254 OPEN
cece04c5c8 b64f9a316e test(child_process): cover failed spawn exit codes #43254 OPEN
3ff0efc822 c232089959 fix(stream): await buffered pipe writes before completing callbacks #43879 MERGED
Qualification / formatting adjustment 7e3ba2fdbc fix(stream): construct wrappers around open FileSinks synchronously Not separately identified

Qualified together with the complete integrated stack on darwin-arm64 at 7e3ba2fdbcd4530ea39504f4a17257930056d9fa using bun scripts/build.ts --profile=release, linked to unchanged WebKit f20ce7744553c910bcf16a33faf976af208de091. The release binary’s revision was verified before tests.

BUN_FEATURE_FLAG_INTERNAL_FOR_TESTING=1 BUN_GARBAGE_COLLECTOR_LEVEL=0 build/release/bun test <file> --max-concurrency 2

Test file Pass Skip Todo Fail
test/js/bun/bun-object/write.spec.ts 23 0 0 0
test/js/bun/console/console-write.test.ts 5 0 0 0
test/js/bun/spawn/spawn.ipc.test.ts 19 0 0 0
test/js/bun/util/filesink.test.ts 69 2 0 0
test/js/node/child_process/child-process-stdio.test.js 13 0 0 0
test/js/node/child_process/child_process.test.ts 91 12 1 0
test/js/node/fs/fs.test.ts 682 16 0 0
test/js/node/stream/node-stream.test.js 113 0 5 0

Independent Codex review found no actionable P0/P1 findings. Local JavaScript lint and Rust/C++/TypeScript formatting checks passed. Cross-target Rust checking passed all 12 targets with release codegen inputs (0 failed, 0 skipped). No workflow or WebKit-pin changes.

The first integrated run exposed asynchronous construction delaying the first child.stdin write until after unref. The wrapper now receives its already-open FileSink at construction, preserving the stdio keep-alive regression from #28. One existing FileSink promise-identity assertion failed once; 30 isolated repeats and 20 full-file repeats then passed on both published baseline 7862bb3 and candidate. The rebuilt eval suite hit one 1ms startup trap inside macOS pthread_jit_write_protect_np. The exact test passed 30 isolated repeats on both baseline and candidate; the full candidate file passed 10 serialized repeats. Overlapping reruns briefly collided on the suite’s shared fixture path and were discarded, then rerun serially. No code or assertions were changed for these incidents. The table above records the final rebuilt qualification.

Integrates oven-sh#36405 for the custom OpenClaw runtime.

Co-authored-by: robobun <[email protected]>

(cherry picked from commit 73342fd)
Join explicit FileSink flushes through the existing pending operation, including in-flight Windows writes. Route fs.WriteStream through Writable queue, cork, drain, and error handling while retaining the upstream final flush and current descriptor ownership. Preserve console.write promise byte counts and deferred flush errors.

(cherry picked from commit 3ff0efc)
@steipete
steipete merged commit 4c1d6f6 into main Sep 30, 2026
9 of 10 checks passed
@steipete
steipete deleted the claude/port-ci-deferred branch September 30, 2026 09:17
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