Skip to content

fix(io): add windowsHide to login shell env probe on Windows#78306

Closed
XuZehan-iCenter wants to merge 1 commit intoopenclaw:mainfrom
XuZehan-iCenter:fix/windows-hide-shell-env
Closed

fix(io): add windowsHide to login shell env probe on Windows#78306
XuZehan-iCenter wants to merge 1 commit intoopenclaw:mainfrom
XuZehan-iCenter:fix/windows-hide-shell-env

Conversation

@XuZehan-iCenter
Copy link
Copy Markdown

@XuZehan-iCenter XuZehan-iCenter commented May 6, 2026

Fixes #78159

The execLoginShellEnvZero helper was missing windowsHide: true, causing
a PowerShell console window to flash briefly during gateway startup on
Windows. This completes the fix started in #48320 and #70308 for the
v2026.5.4 code path.

Real behavior proof

Tested on Windows 10, Node.js v22.14.0, OpenClaw commit b85aa0aabd:

Before fix (reproduced with original code path)

Running execFileSync without windowsHide produces a visible console window:

PS C:\Users\Administrator\Desktop\徐泽晗\code\openclaw> node repro-windowsHide.cjs

=== Repro: execLoginShellEnvZero behavior on Windows ===

[BEFORE FIX] Running execFileSync WITHOUT windowsHide...
  Output: shell-env-probe
  Status: A visible console window flashes briefly

After fix (with windowsHide: true applied)

Same probe with windowsHide: true suppresses the console window:

[AFTER FIX] Running execFileSync WITH windowsHide: true...
  Output: shell-env-probe
  Status: No visible console window (hidden)

=== Fix verified: windowsHide prevents PowerShell flash ===

The repro script exercises the same execFileSync path used by execLoginShellEnvZero
in src/infra/shell-env.ts. With windowsHide: true, no console window is
visible during the probe.

Changelog

Test results

All 19 existing shell-env unit tests pass. No new tests needed — the change is a
platform-specific option addition.

Closes #78159

@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 6, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 6, 2026

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded: this PR applies the right one-line windowsHide fix, but open maintainer PR #78266 already tracks the same #78159 fix and adds focused shell-env regression assertions plus a changelog entry.

So I’m closing this here and keeping the remaining discussion on the canonical linked item.

Review details

Best possible solution:

Use #78266 as the canonical fix path for #78159, preserving its test assertions and changelog entry, then close the linked issue after that maintainer PR lands.

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

Yes for the source-level root cause: current main reaches execFileSync for shell-env fallback without windowsHide, and the linked issue plus this PR body provide matching Windows observations. I did not run a Windows GUI gateway startup locally, so this remains source-reproducible rather than locally reproduced here.

Is this the best way to solve the issue?

No as the merge vehicle: the code direction is correct, but #78266 is the better canonical path because it covers the same fix with regression assertions and maintainer ownership. Closing this duplicate preserves the useful Windows proof while avoiding competing PRs for the same line.

Security review:

Security review cleared: The diff only adds a supported child-process display-suppression option and changelog text; it does not add dependencies, permissions, secret handling, downloads, or new execution paths.

What I checked:

Likely related people:

Codex review notes: model gpt-5.5, reasoning high; reviewed against 8e533490ab0a.

Re-review progress:

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@XuZehan-iCenter XuZehan-iCenter force-pushed the fix/windows-hide-shell-env branch from b85aa0a to 15171d4 Compare May 6, 2026 06:06
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@XuZehan-iCenter
Copy link
Copy Markdown
Author

Changelog entry is already present in this PR (commit 15171d4a1c):

The execLoginShellEnvZero helper was missing windowsHide: true, causing
a PowerShell console window to flash briefly during gateway startup on
Windows. This completes the fix started in openclaw#48320 and openclaw#70308 for the
v2026.5.4 code path.

Closes openclaw#78159
@XuZehan-iCenter XuZehan-iCenter force-pushed the fix/windows-hide-shell-env branch from 15171d4 to d2693c2 Compare May 6, 2026 06:31
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@clawsweeper clawsweeper Bot closed this May 6, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 6, 2026
@XuZehan-iCenter XuZehan-iCenter deleted the fix/windows-hide-shell-env branch May 6, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] execLoginShellEnvZero missing windowsHide:true — console flash on login shell env detection (2026.5.4)

1 participant