Skip to content

fix(windows): add windowsHide to all Windows spawn resolution paths#48320

Open
TerminalsandCoffee wants to merge 1 commit intoopenclaw:mainfrom
TerminalsandCoffee:fix/windows-acpx-console-flash
Open

fix(windows): add windowsHide to all Windows spawn resolution paths#48320
TerminalsandCoffee wants to merge 1 commit intoopenclaw:mainfrom
TerminalsandCoffee:fix/windows-acpx-console-flash

Conversation

@TerminalsandCoffee
Copy link
Copy Markdown

Summary

  • Adds windowsHide: true to the direct and shell-fallback resolution paths in src/plugin-sdk/windows-spawn.ts
  • These were the only two Windows-path resolutions missing the flag — all other paths (node-entrypoint, exe-entrypoint) already set it
  • All downstream spawn call sites (acpx runtime, lobster, ACP client) correctly forward windowsHide from the resolution, so the fix propagates automatically
  • Adds test coverage for direct .exe resolution asserting windowsHide: true
  • Updates shell-fallback test expectation to include windowsHide: true
  • Adds windowsHide: true to raw spawn() calls in test files to prevent console flash during test runs on Windows

Root Cause

resolveWindowsSpawnProgramCandidate() only set windowsHide: true for node-entrypoint and exe-entrypoint resolutions. The direct path (e.g. .exe files resolved on Windows) and the shell-fallback path (unresolved .cmd wrappers) left windowsHide as undefined, causing every ACP spawn to flash a visible cmd.exe console window.

Test plan

  • pnpm vitest run extensions/acpx/src/runtime-internals/process.test.ts — 15/15 passing
  • New test: sets windowsHide on direct exe resolution on windows
  • Updated test: falls back to shell mode now asserts windowsHide: true
  • No-op on macOS/Linux — windowsHide is ignored on non-Windows platforms

Closes #40340

🤖 Generated with Claude Code

The direct and shell-fallback resolution paths in the plugin SDK's
Windows spawn resolver were missing windowsHide: true, causing visible
cmd.exe console windows to flash on every ACP spawn on Windows desktop.

Closes openclaw#40340

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 16, 2026

Greptile Summary

This PR closes a Windows UX regression where every ACP spawn would flash a visible cmd.exe console window by adding windowsHide: true to the two resolution paths (direct and shell-fallback) that were previously missing the flag in resolveWindowsSpawnProgramCandidate / applyWindowsSpawnProgramPolicy.

  • Core fix (src/plugin-sdk/windows-spawn.ts): windowsHide: true added to the direct return (line 252) and to the shell-fallback return inside applyWindowsSpawnProgramPolicy (line 275). The remaining paths (node-entrypoint, exe-entrypoint) already carried the flag, so all four resolution branches are now consistent.
  • New test (process.test.ts): "sets windowsHide on direct exe resolution on windows" exercises the previously uncovered direct path with an absolute .exe path on a simulated win32 runtime.
  • Updated test (process.test.ts): The "falls back to shell mode" expectation is updated to assert windowsHide: true, aligning with the production change.
  • Housekeeping (process.test.ts, mcp-proxy.test.ts): Raw spawn() calls in test files now include windowsHide: true to suppress console flash during CI runs on Windows — these do not affect test logic.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, targeted bug fix with full test coverage and no behavioral change on non-Windows platforms.
  • The change is confined to two one-line additions in well-isolated helper functions. All resolution paths are now consistently marked with windowsHide: true on Windows. The fix propagates automatically to all downstream spawn call sites through the existing forwarding logic in applyWindowsSpawnProgramPolicy. New and updated tests cover both previously-untested paths. The change is a no-op on macOS/Linux.
  • No files require special attention.

Last reviewed commit: 8d36db3

@johnsonshi
Copy link
Copy Markdown
Contributor

I reviewed this change and the implementation looks sound. The patch fills the two missing Windows resolution outcomes in src/plugin-sdk/windows-spawn.tsdirect and shell-fallback—by setting windowsHide: true, which matches the gap here.

I also checked the surrounding call sites, and the resolved windowsHide value is already propagated through the relevant ACPX / ACP client / lobster spawn paths, so this should flow through as intended without additional plumbing in those layers.

The tests line up with the change: there’s a new direct-.exe resolution assertion, the shell-fallback expectation now checks windowsHide: true, and the small test-only raw spawn() updates are consistent with avoiding Windows console flashes during test runs.

From a code and scope perspective, this looks reasonable to land.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(acpx): Windows console windows flash on every ACP spawn — missing windowsHide: true

2 participants