fix(process): disable detached spawn on Windows to fix empty exec output#18067
Merged
steipete merged 1 commit intoopenclaw:mainfrom Feb 16, 2026
Merged
Conversation
…put (openclaw#18035) The supervisor's child adapter always spawned with `detached: true`, which creates a new process group. On Windows Scheduled Tasks (headless, no console), this prevents stdout/stderr pipes from properly connecting, causing all exec tool output to silently disappear. The old exec path (pre-supervisor refactor) never used `detached: true`. The regression was introduced in cd44a0d (refactor process spawning). Changes: - child.ts: set `detached: false` on Windows, keep `detached: true` on POSIX (where it's needed to survive parent exit). Skip the no-detach fallback on Windows since it's already the default. - child.test.ts: platform-aware assertions for detached behavior. Fixes openclaw#18035 Fixes openclaw#17806
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical regression where the exec tool returned empty output on Windows when running under Scheduled Tasks (headless environments). The issue was introduced in the supervisor refactor (cd44a0d) which always spawned child processes with detached: true. On Windows, this creates a new process group that can prevent stdout/stderr pipes from connecting properly in headless scenarios.
Changes:
- Modified
createChildAdapterto usedetached: falseon Windows anddetached: trueon POSIX systems - Removed the no-detach fallback on Windows since detached defaults to false
- Updated tests to verify platform-specific spawn behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/process/supervisor/adapters/child.ts | Platform-aware detached spawn setting: false on Windows for pipe compatibility, true on POSIX with fallback |
| src/process/supervisor/adapters/child.test.ts | Platform-specific test assertions to verify correct detached behavior and fallback configuration |
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
Fix exec tool returning
(no output)on Windows, a regression from the supervisor refactor in cd44a0d.Fixes #18035
Fixes #17806
Root Cause
The new
createChildAdapteralways spawns withdetached: true. On Windows Scheduled Tasks (headless, no console),detached: truecreates a new process group that can prevent stdout/stderr pipes from connecting. The oldrunCommandWithTimeoutinexec.tsnever useddetached: true.The no-detach fallback only triggers on
EBADFspawn errors. The pipe disconnection issue does not throw — it silently produces empty output.Fix
On Windows (
process.platform === "win32"), default todetached: false. On POSIX, keepdetached: truewith the no-detach fallback.Tests
child.test.tswith platform-aware assertions.Sign-Off
Greptile Summary
Fixed Windows exec output regression by disabling
detached: truespawn mode. On Windows Scheduled Tasks (headless environments), detached mode creates a new process group that silently prevents stdout/stderr pipes from connecting. The fix conditionally usesdetached: falseon Windows while maintainingdetached: trueon POSIX systems with a fallback mechanism.Confidence Score: 5/5
Last reviewed commit: 1163407