fix(process): add windowsHide to spawn in runCommandWithTimeout#51559
Open
gushiaoke wants to merge 2 commits intoopenclaw:mainfrom
Open
fix(process): add windowsHide to spawn in runCommandWithTimeout#51559gushiaoke wants to merge 2 commits intoopenclaw:mainfrom
gushiaoke wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Contributor
Greptile SummaryThis PR adds
Confidence Score: 5/5
Last reviewed commit: "fix(process): add wi..." |
On Windows, child_process.spawn() without windowsHide: true causes a visible cmd.exe window to flash briefly for every spawned process. This is especially noticeable during gateway startup when git commands are invoked by ensureGitRepo(). Add windowsHide: true to the spawn options in runCommandWithTimeout(), which is the central command execution function. This property is ignored on non-Windows platforms, so there is no behavioral change elsewhere.
24954ed to
f416a00
Compare
Contributor
Author
|
The two failing checks — This PR only modifies Error details:
These are Vitest SSR module resolution flaky failures in CI ( A re-run should clear these. |
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
runCommandWithTimeout()spawns child processes withoutwindowsHide: true, causing a visible cmd.exe window to flash briefly for every spawned command. This is especially noticeable during gateway startup whenensureGitRepo()invokesgit --versionandgit init.windowsHide: trueto thespawn()options inrunCommandWithTimeout()(src/process/exec.ts).runCommandWithTimeoutfunction was touched. No behavioral changes on non-Windows platforms (windowsHideis ignored on macOS/Linux).Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Security Impact (required)
NoNoNoNoNoRepro + Verification
Environment
Steps
openclaw gateway run)ensureGitReporuns git commands)Expected
Actual
spawn()is called withoutwindowsHide: trueEvidence
windowsHideoption is a documented Node.js spawn option specifically designed to prevent this behavior on Windows.Human Verification (required)
windowsHideis ignored on non-Windows platforms (no behavioral change on macOS/Linux).runCommandWithTimeout; other sites may also benefit from the same fix).Review Conversations
Compatibility / Migration
YesNoNoFailure Recovery (if this breaks)
windowsHide: trueinsrc/process/exec.tssrc/process/exec.tswindowsHideis a no-op on non-WindowsRisks and Mitigations
None— this is a well-documented Node.js API option with no side effects on non-Windows platforms.AI-assisted PR (CodeBuddy). Fully tested on Windows 11. I understand what the code does.