fix(process): add windowsHide to spawn in runCommandWithTimeout#51559
fix(process): add windowsHide to spawn in runCommandWithTimeout#51559gushiaoke wants to merge 2 commits intoopenclaw:mainfrom
Conversation
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
|
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. |
|
Closing this as implemented after Codex review. Current What I checked:
So I’m closing this as already implemented rather than keeping a duplicate issue open. Review notes: reviewed against 608c08fc54da; fix evidence: release v2026.4.22, commit 00bd2cf7a376. |
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.