Skip to content

fix(windows): keep background startup consoles hidden - #152452

Merged
steipete merged 1 commit into
mainfrom
codex/fix-windows-background-console
Sep 19, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-windows-background-console

Conversation

@steipete

@steipete steipete commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Background OpenClaw processes can open an unwanted blank console on Windows when startup respawns Node to adjust runtime flags or select a compatible runtime.

User Impact

Background startup stays out of the desktop. Commands launched from a terminal retain their console and input, and background output continues to use the inherited log files.

Why This Change Was Made

Both existing respawn owners now hide the child window when neither stdin nor stdout is a terminal. This preserves the existing terminal policy, process ownership, signal forwarding, and exit handling.

The installed updater still runs its existing helper before replacing the package; this change applies when the candidate's startup helper runs. No runtime-selection or update-policy change is included.

Evidence

  • 153 focused tests passed on current main, including startup, runtime recovery, compile-cache, and child signal/exit behavior. The regression assertion fails without the fix.
  • Relevant core/script/test type checks, lint, formatting, and changed guards passed. Independent P2 review found no actionable findings.
  • Published-driver update proof passed on this exact commit: the published [email protected] updater installed the frozen candidate, preserved the synthetic project, and passed both Doctor checks without follow-up repair. This was an isolated Linux package-update test with no live providers.
  • All six native Windows fixture cases passed on Node 24.19: both baseline background owners opened a visible console, both patched owners stayed hidden, and both foreground controls retained the same console, real terminal input, and exit code 37. Background logging and survival after bootstrap exit also passed. All synthetic processes exited and both task leases were released.
Native proof scope

The fixtures invoke the real startup and recovery owners with a synthetic child; this is not a full packaged CLI or cloud-session run. Owner source matches this PR exactly. The recovery bundle also matches the current dependency build byte-for-byte. The startup fixture retained tslog 5.1.0 while the current checkout uses 5.2.0; a current-dependency rebuild was prepared but did not run before the lease deadline. Current-main tests and the separate package-update run above cover the final commit. Earlier service-preflight and fixture failures are retained separately from the successful six-case run.

Before: native Windows background respawn opens a blank console

After: native Windows background respawn stays hidden

@clawsweeper

clawsweeper Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 19, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 19, 2026
@clawsweeper

clawsweeper Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 19, 2026, 1:35 AM ET / 05:35 UTC (Revision 4).

ClawSweeper review

What this changes

The PR hides background Windows consoles during startup and runtime-recovery respawns while preserving foreground terminal behavior.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary on fetched main and the latest release. No actionable correctness or security findings remain, and the native Windows evidence supports the intended behavior.

Priority: P2
Reviewed head: a266893ab2032268b8e7870f1dc468ab2eb97690

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable repair with convincing native before/after evidence and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected native Windows before/after screenshots and the reported six-case run through both real respawn owners demonstrate hidden background consoles with foreground input, logging, and exit behavior preserved. The disclosed fixture dependency difference and Linux-only package-update scope do not invalidate this focused native proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected native Windows before/after screenshots and the reported six-case run through both real respawn owners demonstrate hidden background consoles with foreground input, logging, and exit behavior preserved. The disclosed fixture dependency difference and Linux-only package-update scope do not invalidate this focused native proof.
Evidence reviewed 8 items Introduced production change: Both existing respawn owners add only terminal-dependent windowsHide behavior; inherited streams, executable selection, environment, detachment, signal handling, and exit propagation remain intact. The verified test merge has the pinned base and PR head as its ordered parents and preserves this narrow change.
Current-main necessity: At fetched main, both spawn calls still omit windowsHide. The existing hidden Gateway launcher does not supply this missing option to subsequent Node respawns.
Latest-release comparison: The v2026.9.5 versions of both respawn owners also omit windowsHide; the requested repair is not already present in the supplied latest release.
Findings None None.
Security None None.

How this fits together

OpenClaw can restart Node during startup to adjust runtime flags, configure compilation caching, or select a supported runtime. These respawn owners launch the replacement process and preserve its input, output, signals, and exit status.

flowchart TD
  A[OpenClaw startup] --> B[Runtime or startup adjustment]
  B --> C[Existing respawn owners]
  C --> D{Input or output is a terminal?}
  D -->|Yes| E[Preserve foreground console]
  D -->|No| F[Hide Windows child console]
  E --> G[Replacement Node process]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1, Tests +26, Other +2. Total +29 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 0 +1
Tests 3 30 4 +26
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 5 33 4 +29

Review metrics

None.

Technical review

Best possible solution:

Keep console visibility policy in the existing respawn owners, preserving terminal input, inherited logs, and process lifecycle behavior.

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

Yes: background Windows startup reaches two spawn calls that omit window hiding on main, and the submitted native baseline demonstrates the blank console. This review did not execute a fresh reproduction.

Is this the best way to solve the issue?

Yes: adding the platform spawn option at both existing owners is a narrow repair, with foreground controls and native background proof supporting the chosen terminal policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9f8bb9ebad59.

Labels

Label justifications:

  • P2: Unwanted Windows background consoles are a bounded user-facing defect with a focused repair.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected native Windows before/after screenshots and the reported six-case run through both real respawn owners demonstrate hidden background consoles with foreground input, logging, and exit behavior preserved. The disclosed fixture dependency difference and Linux-only package-update scope do not invalidate this focused native proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected native Windows before/after screenshots and the reported six-case run through both real respawn owners demonstrate hidden background consoles with foreground input, logging, and exit behavior preserved. The disclosed fixture dependency difference and Linux-only package-update scope do not invalidate this focused native proof.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected native Windows before/after screenshots and the reported six-case run through both real respawn owners demonstrate hidden background consoles with foreground input, logging, and exit behavior preserved. The disclosed fixture dependency difference and Linux-only package-update scope do not invalidate this focused native proof.

Evidence

What I checked:

  • Introduced production change: Both existing respawn owners add only terminal-dependent windowsHide behavior; inherited streams, executable selection, environment, detachment, signal handling, and exit propagation remain intact. The verified test merge has the pinned base and PR head as its ordered parents and preserves this narrow change. (src/process/respawn-child-runner.ts:33, a266893ab203)
  • Current-main necessity: At fetched main, both spawn calls still omit windowsHide. The existing hidden Gateway launcher does not supply this missing option to subsequent Node respawns. (src/process/respawn-child-runner.ts:29, 9f8bb9ebad59)
  • Latest-release comparison: The v2026.9.5 versions of both respawn owners also omit windowsHide; the requested repair is not already present in the supplied latest release. (node-runtime-recovery.mjs:72, ec9c1a13db89)
  • Native Windows proof: Inspected both downloaded PR screenshots: the baseline shows a blank console and the patched capture shows the desktop without it. The captured PR body reports six Node 24.19 cases exercising the real startup and recovery owners: baseline/background, patched/background, and foreground controls, including terminal input, exit 37, inherited logging, and survival after bootstrap exit. These are owner fixtures with synthetic children, not a full packaged CLI run. The disclosed startup-fixture tslog 5.1.0 versus checkout 5.2.0 difference does not change the reviewed spawn option. Captured context sourceRevision: 981d0ad0b807e993951f8f0b8a08f1ca6b939140568f50ae7304238e6d990391. (a266893ab203)
  • Published-driver update evidence: https://github.com/openclaw/openclaw/actions/runs/35419956684 completed successfully, including published-upgrade-survivor. Its artifact inventory identifies the a266893 candidate; the workflow head is separately c89cd69. The captured body reports that [email protected] installed the candidate, preserved the synthetic project, and passed Doctor checks on Linux. Detailed job-log retrieval was blocked at the artifact storage host, so those observations remain attributed to the submitted evidence. (a266893ab203)
  • Focused regression coverage: The recovery test matrix covers neither stream being a terminal, stdin alone, and stdout alone, while retaining invocation, environment, working-directory, and exit assertions. Existing runner tests cover background and foreground spawn options. Tests were inspected but not executed under this read-only review. (src/infra/node-runtime-recovery.test.ts:853, a266893ab203)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-19T03:59:47.589Z sha a266893 :: blocked before merge. :: none
  • reviewed 2026-09-19T04:29:20.352Z sha a266893 :: blocked before merge. :: none
  • reviewed 2026-09-19T05:00:36.374Z sha a266893 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Sep 19, 2026
@steipete
steipete marked this pull request as ready for review September 19, 2026 05:30
@clawsweeper

clawsweeper Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: applying reviewed decision.

I am applying the reviewed decision for this pull request: fix(windows): keep background startup consoles hidden This is item 1/1 in the current shard. Shard 1/1.

This transient lease prevents a newer review from overlapping label, comment, or close mutations.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete merged commit a18631a into main Sep 19, 2026
294 of 295 checks passed
@steipete
steipete deleted the codex/fix-windows-background-console branch September 19, 2026 06:44
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant