Skip to content

[codex] Hide Windows exec console windows#59466

Merged
steipete merged 3 commits intoopenclaw:mainfrom
lawrence3699:codex/58566-windows-exec-hide
Apr 2, 2026
Merged

[codex] Hide Windows exec console windows#59466
steipete merged 3 commits intoopenclaw:mainfrom
lawrence3699:codex/58566-windows-exec-hide

Conversation

@lawrence3699
Copy link
Copy Markdown
Contributor

Summary

This hides Windows console windows for the main exec code paths used by OpenClaw tools and command runners.

Root Cause

runExec and runCommandWithTimeout spawned Windows child processes without windowsHide: true. That caused brief visible console windows even though similar process launch sites elsewhere in the codebase were already hidden.

Changes

  • add windowsHide: true to both Windows execFile paths in runExec
  • add windowsHide: true to the spawn path in runCommandWithTimeout
  • keep the existing .cmd wrapping, npm shim resolution, and windowsVerbatimArguments behavior unchanged
  • add regression tests that assert the hidden-window option across wrapped, shimmed, and direct Windows execution paths

Validation

  • pnpm exec vitest run src/process/exec.windows.test.ts

Notes

  • Windows manual verification is still recommended to confirm there is no visible console flash in a real desktop session.

Fixes #58566

@lawrence3699 lawrence3699 marked this pull request as ready for review April 2, 2026 05:47
Copilot AI review requested due to automatic review settings April 2, 2026 05:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the core process execution helpers to hide transient Windows console windows by consistently setting windowsHide: true on the primary execFile and spawn code paths, aligning behavior with other Windows spawn sites in the repo.

Changes:

  • Add windowsHide: true to both Windows execution branches in runExec (execFile direct + cmd.exe wrapper).
  • Add windowsHide: true to the spawn options in runCommandWithTimeout.
  • Expand Windows-specific regression tests to assert windowsHide across wrapped, shimmed, and direct invocation paths.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/process/exec.ts Ensures Windows child processes spawned via execFile/spawn are created with hidden console windows.
src/process/exec.windows.test.ts Adds assertions/tests verifying windowsHide is applied for wrapper, npm shim, and direct runExec paths.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 2, 2026

Greptile Summary

This PR adds windowsHide: true to the two execFileAsync call sites in runExec and the spawn call in runCommandWithTimeout, suppressing the brief console flash seen when OpenClaw tools spawn child processes on Windows. The option is safely ignored on non-Windows platforms by Node.js. Tests cover all three execution paths: cmd.exe-wrapped .cmd shims, the direct execFile path, and npm shim spawns.

Confidence Score: 5/5

  • Safe to merge — minimal, targeted change with full test coverage for all affected code paths.
  • All three child-process launch paths now carry the option, the option is a no-op on non-Windows, and the new/updated tests assert the flag across wrapped, shimmed, and direct execution paths. No P0/P1 findings.
  • No files require special attention.

Reviews (1): Last reviewed commit: "fix(exec): hide windows console windows" | Re-trigger Greptile

@steipete steipete force-pushed the codex/58566-windows-exec-hide branch from b20af0b to 9108888 Compare April 2, 2026 16:51
steipete added a commit to lawrence3699/openclaw that referenced this pull request Apr 2, 2026
steipete added a commit to lawrence3699/openclaw that referenced this pull request Apr 2, 2026
@steipete steipete force-pushed the codex/58566-windows-exec-hide branch from 9108888 to 81cde4c Compare April 2, 2026 16:59
steipete added a commit to lawrence3699/openclaw that referenced this pull request Apr 2, 2026
@steipete steipete force-pushed the codex/58566-windows-exec-hide branch from 81cde4c to da7810c Compare April 2, 2026 17:02
steipete added a commit to lawrence3699/openclaw that referenced this pull request Apr 2, 2026
@steipete steipete force-pushed the codex/58566-windows-exec-hide branch from da7810c to 1daac0c Compare April 2, 2026 17:15
@steipete steipete force-pushed the codex/58566-windows-exec-hide branch from 1daac0c to 1d72c00 Compare April 2, 2026 17:19
@steipete steipete merged commit 9b48a4d into openclaw:main Apr 2, 2026
9 checks passed
@steipete
Copy link
Copy Markdown
Contributor

steipete commented Apr 2, 2026

Landed via temp rebase onto main.

  • Gate: pnpm check && pnpm test && pnpm build; final integration rerun pnpm check && pnpm test -- src/process/exec.windows.test.ts src/process/exec.test.ts src/infra/exec-command-resolution.test.ts src/infra/executable-path.test.ts src/agents/bash-tools.exec.script-preflight.test.ts && pnpm build
  • Land commit: 1d72c00
  • Merge commit: 9b48a4d

Thanks @lawrence3699!

steipete added a commit to duncanita/openclaw that referenced this pull request Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: missing windowsHide in exec spawn paths causes console window flashes

3 participants