fix: Windows daemon ENOENT, keepalive drain, and headless worker shell resolution#1447
Open
onurgoz wants to merge 1 commit intoruvnet:mainfrom
Open
fix: Windows daemon ENOENT, keepalive drain, and headless worker shell resolution#1447onurgoz wants to merge 1 commit intoruvnet:mainfrom
onurgoz wants to merge 1 commit intoruvnet:mainfrom
Conversation
…worker shell resolution - Quote process.execPath when spawning daemon on Windows to handle spaces in paths like "C:\Program Files\nodejs\node.exe" (ENOENT) - Add setInterval keepalive before bare Promise in quiet/foreground daemon mode to prevent premature event loop exit when no active I/O - Use shell: true for headless worker spawn on Windows so Node can resolve 'claude' to 'claude.cmd' via PATH Ref ruvnet#1446
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 3 of 4 bugs reported in #1446 — Windows daemon and headless worker failures:
Bug 1: Daemon ENOENT with spaced paths
spawn(process.execPath, ...)withshell: trueon Windows fails whenprocess.execPathcontains spaces (e.g.C:\Program Files\nodejs\node.exe) because cmd.exe splits on unquoted spaces.Fix: Quote
process.execPathon Windows before passing to spawn.Bug 2: Daemon dies in quiet/detached mode
await new Promise(() => {})alone does not keep the Node.js event loop alive when there's no active I/O handle. The daemon exits within 1-2 seconds.Fix: Add
setInterval(() => {}, 60_000)as an active timer handle before the blocking promise.Bug 3: Headless workers empty output on Windows
spawn('claude', ...)withoutshell: truefails on Windows becauseclaudeis installed asclaude.cmd— Node'sspawndoesn't search PATH for.cmdextensions without shell mode.Fix: Add
shell: trueto spawn options on Windows.Changed files
v3/@claude-flow/cli/src/commands/daemon.tsprocess.execPathon Windowsv3/@claude-flow/cli/src/commands/daemon.tssetIntervalkeepalive in quiet modev3/@claude-flow/cli/src/services/headless-worker-executor.tsshell: trueon WindowsTest plan
C:\Program Files\:npx ruflo daemon startshould succeed--foreground --quietmodeRef #1446