Skip to content

fix: add windowsHide to all spawn calls to prevent visible console windows on Windows#96839

Closed
shihao-lao wants to merge 2 commits into
openclaw:mainfrom
shihao-lao:fix/windows-exec-hide-window
Closed

fix: add windowsHide to all spawn calls to prevent visible console windows on Windows#96839
shihao-lao wants to merge 2 commits into
openclaw:mainfrom
shihao-lao:fix/windows-exec-hide-window

Conversation

@shihao-lao

Copy link
Copy Markdown

Summary

Fixes #96835

After upgrading from v2026.6.8 to v2026.6.10, every exec call creates a visible cmd/PowerShell console window on Windows. While src/process/supervisor/adapters/child.ts already has windowsHide: true, 9 other spawn() call sites across the codebase were missing this option.

Changes

Added windowsHide: true to all spawn() calls that were missing it:

File Context
src/agents/sessions/exec.ts Session exec commands
src/agents/sessions/tools/find.ts fd (find) tool
src/agents/sessions/tools/grep.ts ripgrep tool
src/agents/tool-search.ts Code mode child process
src/agents/provider-local-service.ts Local service provider
src/agents/sandbox/ssh.ts SSH sandbox (3 spawn calls)
src/auto-reply/reply/stage-sandbox-media.ts SCP media transfer
src/daemon/launchd-restart-handoff.ts Launchd restart handoff
src/process/respawn-child-runner.ts Respawn child runner

Testing

  • Verified all modified spawn calls include windowsHide: true
  • No functional changes to non-Windows platforms (windowsHide is ignored on Linux/macOS)

…ndows on Windows

Fixes openclaw#96835

Multiple spawn() calls across the codebase were missing the windowsHide: true option, causing visible cmd/PowerShell console windows to flash on every command execution on Windows. This was a regression from previous behavior.

Files fixed:
- src/agents/sessions/exec.ts
- src/agents/sessions/tools/find.ts
- src/agents/sessions/tools/grep.ts
- src/agents/tool-search.ts
- src/agents/provider-local-service.ts
- src/agents/sandbox/ssh.ts (3 spawn calls)
- src/auto-reply/reply/stage-sandbox-media.ts
- src/daemon/launchd-restart-handoff.ts
- src/process/respawn-child-runner.ts
@shihao-lao
shihao-lao requested a review from a team as a code owner June 25, 2026 17:41
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jun 25, 2026
@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 1, 2026, 11:07 PM ET / 03:07 UTC.

Summary
The PR adds windowsHide: true to several direct child_process.spawn options across agent local-service, SSH/SCP, session find/grep, tool-search, daemon restart handoff, and respawn helper paths.

PR surface: Source +7. Total +7 across 8 files.

Reproducibility: no. high-confidence live reproduction was performed. Source inspection shows current main still has direct production spawn sites without windowsHide, but the visible Windows desktop behavior needs native proof.

Review metrics: none identified.

Stored data model
Persistent data-model change detected: serialized state: src/agents/sessions/tools/find.ts, serialized state: src/agents/sessions/tools/grep.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #96835
Summary: This PR is a candidate fix for the open Windows exec console-window regression; the Microsoft tracker only references the same Windows-platform area and is not the canonical fix path.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted native Windows after-fix proof showing normal exec/find/grep-style commands no longer flash cmd or PowerShell windows.
  • State whether pty:true remains a separate follow-up, or include proof that the PTY path no longer flashes.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body only says the modified options were checked; it needs redacted native Windows after-fix proof such as a screenshot, recording, terminal output, copied live output, or logs, with private details redacted before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
A short real Windows desktop recording would materially prove the visible console-window behavior that unit tests cannot show. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: on Windows, run normal exec plus a find/grep-style tool command and record whether cmd/PowerShell windows flash after this PR.

Risk before merge

  • [P1] Native Windows after-fix proof is still missing, so the user-visible console-flash regression is not verified as fixed before merge.
  • [P1] The linked report also mentions pty:true; this PR does not touch the @lydell/node-pty adapter, so maintainers should decide whether that is a separate follow-up if Windows proof still shows flicker there.

Maintainer options:

  1. Decide the mitigation before merge
    Merge the remaining windowsHide coverage only after redacted native Windows proof shows the direct spawn paths no longer flash, and keep any PTY-specific failure in the linked issue or a narrower follow-up.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Needs contributor or maintainer native-Windows proof and a maintainer call on any PTY-specific remainder; there is no narrow automated repair target in the code diff.

Security
Cleared: The diff only adds child_process.spawn options and does not change dependencies, scripts, secrets, permissions, package resolution, or downloaded code.

Review details

Best possible solution:

Merge the remaining windowsHide coverage only after redacted native Windows proof shows the direct spawn paths no longer flash, and keep any PTY-specific failure in the linked issue or a narrower follow-up.

Do we have a high-confidence way to reproduce the issue?

No high-confidence live reproduction was performed. Source inspection shows current main still has direct production spawn sites without windowsHide, but the visible Windows desktop behavior needs native proof.

Is this the best way to solve the issue?

Yes for the remaining direct child_process.spawn sites: adding windowsHide: true matches existing OpenClaw spawn patterns. It is not proven as a complete fix for the PTY path, so merge should wait on Windows proof or an explicit follow-up split.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4a2a97777e35.

Label changes

Label justifications:

  • P2: The PR targets a disruptive but platform-specific Windows exec/spawn regression rather than a security issue, data loss, or total runtime outage.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body only says the modified options were checked; it needs redacted native Windows after-fix proof such as a screenshot, recording, terminal output, copied live output, or logs, with private details redacted before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +7. Total +7 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 8 10 3 +7
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 10 3 +7

What I checked:

  • Repository policy applied: Root AGENTS.md was read fully, and its PR review/proof guidance applies because the PR touches core agent/process spawn behavior. (AGENTS.md:10, 4a2a97777e35)
  • Scoped agent policy applied: The scoped agent guide was read fully; its guidance affected the review depth for agent runtime spawn paths. (src/agents/AGENTS.md:1, 4a2a97777e35)
  • PR still changes real spawn paths: The live PR diff adds windowsHide: true to direct production spawn calls, including fd/rg tool spawns and SSH/SCP/local-service helpers that current main still lacks. (src/agents/sessions/tools/find.ts:274, 4783158b3221)
  • Current main still lacks the option on remaining sites: Current main starts provider local services and SSH sandbox processes without windowsHide, so the PR is not fully redundant with main. (src/agents/provider-local-service.ts:264, 4a2a97777e35)
  • Current main already fixed adjacent central exec paths: Current main already sets windowsHide: true in the session exec helper and built-in bash session tool, which means the PR is a partial remaining-coverage fix rather than the only exec-window fix. (src/agents/sessions/exec.ts:88, 4a2a97777e35)
  • Existing OpenClaw hidden-window pattern: The process supervisor child adapter already sets windowsHide: true, so the PR follows an established internal pattern for hidden Windows child processes. (src/process/supervisor/adapters/child.ts:83, 4a2a97777e35)

Likely related people:

  • vincentkoc: Recent live history shows multiple commits on provider local-service and process exec/respawn paths adjacent to the touched spawn behavior. (role: recent area contributor; confidence: medium; commits: 80805ad7a583, 5d6ac2308657, d7866fc89b98; files: src/agents/provider-local-service.ts, src/process/exec.ts, src/process/respawn-child-runner.ts)
  • lawrence3699: Authored the earlier merged Windows exec console-window fix that established windowsHide coverage in core exec behavior. (role: prior Windows exec hidden-window contributor; confidence: medium; commits: 2fd7f7ca5275; files: src/process/exec.ts, src/process/exec.windows.test.ts)
  • steipete: Recent GitHub path history shows broad agent runtime and process-helper refactors around the session/runtime surfaces touched by this PR. (role: adjacent runtime owner; confidence: medium; commits: bb46b79d3c14, f03d7c5a4c40, a628a66e4d1e; files: src/agents/sessions/exec.ts, src/agents/provider-local-service.ts, src/process/exec.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jun 25, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 16, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing due to inactivity.
If you believe this PR should be revived, post in #clawtributors on Discord to talk to a maintainer.
That channel is the escape hatch for high-quality PRs that get auto-closed.

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

Labels

agents Agent runtime and tooling gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS stale Marked as stale due to inactivity status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: exec tool on Windows (v2026.6.10) pops visible cmd/PowerShell window for every command — regression from v2026.6.8

1 participant