Repository navigation
Conversation
Opt-in helper for the disabled Windows CLI apply path (#2811). Starts an explicit drive-absolute .exe via CreateProcessW(CREATE_SUSPENDED), assigns it to an unnamed non-inheritable Job, then resumes. STARTUPINFOEXW whitelists exactly the three owned inheritable stdio handles; output flows over a private single-principal overlapped named pipe. Terminal proof requires the original primary handle signaled plus a successful Job accounting query reporting zero active processes; WAIT_FAILED, query failure, PID absence, acknowledged termination and exit 259 are handled exactly. Installer and pack policies add no deadline, process cap, abort kill or kill-on-close; only the version probe keeps its existing 16 KiB / 8 s / 1 s reap policy. No consumer imports it yet; Windows apply remains refused and ARM64 is unsupported.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
|
✅ Deterministic PR hygiene checks passed. |
2 of 3 tasks
luvs01
marked this pull request as draft
October 24, 2026 06:26
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A Windows CLI installer can leave descendants running after its primary process exits. This adds an internal Windows x64 helper that owns the process tree through a Job object and reports a terminal result only after the original primary handle is signaled and the Job's active-process count reaches zero.
Creation is suspended until Job assignment succeeds. STARTUPINFOEXW restricts inherited handles to owned standard handles, and a private overlapped named pipe drains bounded output without blocking synchronous pipe polling. Wait/query failures remain unknown; exit code 259 is a valid exit code.
Installer and pack policies add no deadline, process-count cap or kill-on-close behavior. The version-probe policy alone uses the existing eight-second deadline and separate one-second reap window. Failure paths retain owned lifetime until it can be reconciled and close each acquired handle once.
Stacked on #7596, targeting
codex/windows-cli-provenance-stack-20261023. This is an eleven-file helper/fixture delta above refreshed parentf7e55ab0; after the parent lands, retarget todevand verify the combined head.Scope and follow-up
No production consumer imports this helper yet, and Windows apply remains disabled. Integration must adopt ownership before every pack/install/probe spawn and retain the lease and staging while lifetime is unknown. This supplies one prerequisite for #2811; it is not complete Windows update support.
This is process-lifetime ownership, not an OS sandbox. ARM64 is unsupported. WMI-created escape processes and reverse inheritance by an unrelated unrestricted CreateProcess call are outside the guarantee.
Verification
0a4eb35a85007f7ad3e6c5948fe5150df92024e3is a normal-merge composition of original head3a260c0eand refreshed parentf7e55ab0(currentdevplus the shared Bun 1.4.4 baseline from chore(test): align Bun runner with the 1.4.4 security baseline #7627), plus the shared one-row CI duration-table correction. Helper implementations and their fixtures/tests are unchanged from the reviewed originals.bun test --isolate --timeout 60000:tests/codex-integration/codex-cli-windows-child.test.ts17 passed / 0 failed / 300 assertions, including the actual owned native child Job/pipe and reap-deadline cases; the cached-PAC reconnect case intests/clients/desktop-compatibility-runtime.test.tspassed. Roottsc --noEmit, structure SSOT, skill-surface and scoped static checks all exited 0.devonlytestRunnerBunchanges to 1.4.4.bc08a484), which contains this change, passed 510 tests / 64 platform skips / 0 failures / 2,911 assertions across 18 units on the same validation.Checklist