Skip to content

fix(shell-env): hide Windows login shell probe#78266

Merged
BradGroux merged 1 commit intomainfrom
maint/issue-78159
May 8, 2026
Merged

fix(shell-env): hide Windows login shell probe#78266
BradGroux merged 1 commit intomainfrom
maint/issue-78159

Conversation

@BradGroux
Copy link
Copy Markdown
Member

Summary

Fixes #78159.

Verification

  • pnpm install --frozen-lockfile
  • pnpm test src/infra/shell-env.test.ts
  • pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/infra/shell-env.ts src/infra/shell-env.test.ts
  • pnpm check:changed

Notes

Windows live visual confirmation was not run from this macOS maintainer workspace; this is the narrow source-backed fix ClawSweeper identified.

Copilot AI review requested due to automatic review settings May 6, 2026 04:28
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels May 6, 2026
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 fixes a Windows UX regression in the shell environment fallback/login-shell probe by ensuring the spawned probe process uses windowsHide: true, preventing a brief console window flash during gateway startup or shell-env refreshes.

Changes:

  • Add windowsHide: true to the login-shell environment probe execFileSync options.
  • Tighten unit tests to assert windowsHide: true is present in the fallback/trusted-shell exec options.
  • Add an Unreleased changelog entry for #78159.

Reviewed changes

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

File Description
src/infra/shell-env.ts Adds windowsHide: true to the login-shell env probe exec options to prevent Windows console flashing.
src/infra/shell-env.test.ts Updates assertions to ensure exec calls include windowsHide: true.
CHANGELOG.md Documents the Windows shell-env probe console-flash fix (Fixes #78159).

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 6, 2026

Codex review: needs maintainer review before merge.

Summary
The PR adds windowsHide: true to the login-shell shell-env probe, updates shell-env tests to assert that option, and adds a changelog entry for the Windows console flash fix.

Reproducibility: Do we have a high-confidence way to reproduce the issue? Yes from source: current main and v2026.5.7 reach execLoginShellEnvZero without windowsHide, and #78306 supplies matching Windows before/after output for the same option path.

Real behavior proof
Not applicable: This is a maintainer-authored PR, so the external-contributor real behavior proof gate does not apply; the PR notes that Windows visual confirmation was not run, while a related closed PR includes Windows before/after output for the same behavior.

Next step before merge
No cleanup or repair lane is appropriate because this protected maintainer PR already contains the narrow fix and needs ordinary maintainer CI/merge handling.

Security
Cleared: The diff only adds a supported Node child-process option, focused tests, and changelog text; it does not broaden dependency, CI, secret, or package execution surfaces.

Review details

Best possible solution:

Land the narrow windowsHide option and focused regression assertions after required exact-head checks complete, keeping shell-env behavior unchanged apart from hiding the Windows child-process window.

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

Do we have a high-confidence way to reproduce the issue? Yes from source: current main and v2026.5.7 reach execLoginShellEnvZero without windowsHide, and #78306 supplies matching Windows before/after output for the same option path.

Is this the best way to solve the issue?

Is this the best way to solve the issue? Yes, adding windowsHide: true to the existing child-process options and asserting it at the shell-env seam is the narrowest maintainable fix; no config, API, or broader Windows process policy change is needed.

What I checked:

  • Protected maintainer PR: Live GitHub API metadata shows this PR is open, mergeable, authored by a MEMBER, and labeled maintainer and size: XS. (deb6ffbd3c20)
  • Current main still lacks the option: execLoginShellEnvZero on current main passes encoding, timeout, maxBuffer, env, and stdio to the exec seam, but not windowsHide. (src/infra/shell-env.ts:90, 132bcebe4110)
  • Runtime path can reach the probe: Config loading can call loadShellEnvFallback when config or environment enables shell-env fallback, including the missing-config path. (src/config/io.ts:1247, 132bcebe4110)
  • Latest release still lacks the option: The v2026.5.7 tagged source has the same execLoginShellEnvZero options object without windowsHide, so the fix is not shipped yet. (src/infra/shell-env.ts:90, eeef4864494f)
  • PR diff is scoped to the intended fix: The live PR diff adds one windowsHide: true option, updates two focused assertions to require it, and adds one changelog bullet. (src/infra/shell-env.ts:95, deb6ffbd3c20)
  • Dependency contract supports the option: Node's child_process docs describe windowsHide as hiding the subprocess console window, and the upstream Node type declarations expose windowsHide?: boolean. (package.json:1784, 132bcebe4110)

Likely related people:

  • steipete: GitHub path history shows repeated shell-env fallback implementation, hardening, and test work, including the shared login-shell exec helper and later coverage updates. (role: introduced behavior and frequent maintainer; confidence: high; commits: 47462eed682e, 607bc53ff38c, 9e56cfcc3588; files: src/infra/shell-env.ts, src/infra/shell-env.test.ts)
  • vincentkoc: GitHub path history shows nearby shell-env probe cache and explicit-empty-variable behavior changes in the same helper and tests. (role: adjacent maintainer; confidence: medium; commits: 418cb55cb907, 114ff23f2ada; files: src/infra/shell-env.ts, src/infra/shell-env.test.ts)

Remaining risk / open question:

  • This PR body does not include direct Windows gateway visual confirmation, although the closed duplicate PR preserves before/after Windows output for the same Node option path.
  • One exact-head check run was still in progress at inspection, so maintainers should rely on the required-check gate before merging.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 132bcebe4110.

Re-review progress:

@BradGroux BradGroux force-pushed the maint/issue-78159 branch from 5527f4d to deb6ffb Compare May 8, 2026 06:34
@BradGroux
Copy link
Copy Markdown
Member Author

Maintainer prep refresh for #78266.

Prepared head: deb6ffbd3c203fc52f5b320fe5ca5aafa11ade57

What I changed:

  • Rebased onto current origin/main.
  • Added the required PR attribution to the changelog entry and kept it in the current section.

Verification:

  • pnpm vitest run src/infra/shell-env.test.ts passed (20 tests).
  • pnpm build passed.
  • pnpm check passed.

Fresh CI should start on the prepared head. Not merging until required/full checks are green.

@BradGroux BradGroux merged commit 2bd4529 into main May 8, 2026
111 checks passed
@BradGroux BradGroux deleted the maint/issue-78159 branch May 8, 2026 06:51
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
Fixes openclaw#78159.

- Add `windowsHide: true` to the login-shell env probe used by shell-env fallback on Windows.
- Cover the fallback and trusted-shell paths with focused tests.
- Add the changelog attribution for openclaw#78266.

Verification:
- `pnpm vitest run src/infra/shell-env.test.ts`
- `pnpm build`
- `pnpm check`
- Full GitHub CI green at `deb6ffbd3c203fc52f5b320fe5ca5aafa11ade57`.
rogerdigital pushed a commit to rogerdigital/openclaw that referenced this pull request May 9, 2026
Fixes openclaw#78159.

- Add `windowsHide: true` to the login-shell env probe used by shell-env fallback on Windows.
- Cover the fallback and trusted-shell paths with focused tests.
- Add the changelog attribution for openclaw#78266.

Verification:
- `pnpm vitest run src/infra/shell-env.test.ts`
- `pnpm build`
- `pnpm check`
- Full GitHub CI green at `deb6ffbd3c203fc52f5b320fe5ca5aafa11ade57`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: XS

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)

2 participants