Repository navigation
Do not detach agent CLI spawns on Windows - #507
Merged
Merged
Conversation
detached:true + cross-spawn of a .cmd shim is DETACHED_PROCESS on win32. The parent waits on cmd.exe (exit 0, empty pipes) while the node grandchild's stdout never arrives, so smoke pass C records Run error (exit 0) with gotResult false. agentSpawnOptions keeps the child attached on win32 (windowsHide) and still detaches on POSIX for process-group kill. Wired through claude, codex, agent, kimi, and opencode.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Fixes #480. Windows
electron/smoke.jsdies on pass C: the Claude fake exits 0, the runner recordsRun error (exit 0), and there is no assistant text, tool card,sessionId, or usage. Pass A/B are green; macOS smoke is green on the same commits. This is the first real signal from thewindows-latestsmoke job added in #449.Cause:
detached: true+cross-spawnof a.cmdshim isDETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP. The parent waits oncmd.exe(exit 0, empty pipes) while the node grandchild's stdout never arrives.gotResultstays false. Pass B works because it spawnsnodedirectly.Fix:
agentSpawnOptionsinelectron/proc.js— attach the child on win32 (windowsHide), still detach on POSIX for process-group kill. Wired throughclaude.js,codex.js,agent.js,kimi.js, andopencode.js. Did not skip pass C, and did not paper over it by changing the fake.Related leftover: #481 (
npm testhang on win32) is the same hole onkillTree(process.kill(-pid)already falls back).Tests
Mutations in
electron/test/claude-spawn.test.js(on the win32 electron list):resultline →gotResult === trueresultline → events still parse,gotResult === false(pass C would still fail).cmd→ not a silent exit 062 related electron tests pass.
npm run test:smokeon macOS is green through A–E.windows-latestsmoke is the remaining proof.