Skip to content

fix(install): Windows installer no longer reports failed doctor migration as complete - #120033

Merged
steipete merged 3 commits into
mainfrom
steipete/install-ps1-doctor-exit
Aug 7, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/install-ps1-doctor-exit

Conversation

@steipete

@steipete steipete commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where the Windows installer printed [OK] Migration complete even when openclaw doctor --non-interactive failed. Invoke-OpenClawCommand invoked the CLI with & and never checked $LASTEXITCODE — PowerShell does not throw on nonzero child exit — so the try/catch around the doctor run could never catch a failure, and every other installer step using the wrapper had the same blind spot.

Why This Change Was Made

The wrapper is the owner of the child-process contract, so it now throws on any nonzero exit code (openclaw <args> failed with exit code N). Run-Doctor keeps migration failures non-fatal for the install as intended, but reports honestly: success prints [OK] Migration complete only inside the success path, and failure prints a warning naming the exact command to rerun.

User Impact

Windows operators whose config migration fails during install now see it immediately with a recovery command, instead of discovering a stale config later.

Evidence

  • node scripts/run-vitest.mjs test/scripts/install-ps1.test.ts — passes, with new regression tests asserting the wrapper throws on nonzero exit and that Run-Doctor emits the failure branch text (and no false [OK]).
  • Codex autoreview (gpt-5.6-sol, high) over the change bundle: clean, no actionable findings.

Invoke-OpenClawCommand ignored the child exit code, so a failed
'openclaw doctor --non-interactive' still printed '[OK] Migration complete'.
The wrapper now throws on nonzero exit and Run-Doctor reports the failure
with the exact command to rerun instead of claiming success.
@steipete
steipete marked this pull request as ready for review August 6, 2026 19:00
@steipete steipete closed this Aug 6, 2026
@steipete steipete reopened this Aug 6, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Aug 6, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 6, 2026
@clawsweeper

clawsweeper Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 7, 2026, 3:38 AM ET / 07:38 UTC.

ClawSweeper review

What this changes

The PR makes the Windows installer throw on nonzero OpenClaw CLI exits and show a doctor-migration recovery warning instead of falsely reporting success.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open: the prior P2 finding remains on the exact head, so the new regression fixtures can fail without failing Vitest. The production repair is otherwise the correct shared-wrapper boundary fix.

Priority: P1
Reviewed head: 4e8a72fc7f64354621ce88f9d590165b59473c09

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The owner-boundary production fix is sound, but its new regression coverage is presently non-enforcing.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; the supplied focused-test claim is not an observed Windows installer run.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; the supplied focused-test claim is not an observed Windows installer run.
Evidence reviewed 4 items Current-main defect: Current main still invokes the native command without checking its exit code and prints migration success after an empty catch; the PR head changes both paths.
Unasserted regression fixtures: Both new fixture failures are converted to stored failed results, while no assertion invokes either fixture, allowing the focused suite to pass despite either regression.
Prior finding remains unchanged: The affected installer and test files have no diff since the previous reviewed head, so the existing P2 finding remains rather than being a late discovery.
Findings 1 actionable finding [P2] Assert both added PowerShell regression cases
Security None None.

How this fits together

The Windows installer calls the OpenClaw CLI through a shared PowerShell wrapper, then reports setup and migration outcomes to the operator. The wrapper’s exit handling affects doctor migration and other installer command steps.

flowchart LR
  A[Windows installer] --> B[Shared command wrapper]
  B --> C[OpenClaw CLI]
  C --> D{Exit status}
  D -->|success| E[Migration complete]
  D -->|failure| F[Recovery warning]
Loading

Before merge

  • Assert both added PowerShell regression cases (P2) - The batch runner records fixture exceptions as { ok: false }, and no expectBatchedPowerShellCase call names either new fixture. Consequently both regressions can fail while Vitest passes; add direct assertions for each case.
  • Resolve merge risk (P1) - The two added failure fixtures are not asserted, so green focused or CI tests do not prove either reported failure path.
  • Complete next step (P2) - The concrete test repair is clear, but this maintainer-labeled PR remains in its author/maintainer review lane rather than a repair-job queue.

Findings

  • [P2] Assert both added PowerShell regression cases — test/scripts/install-ps1.test.ts:108-135
Agent review details

Security

None.

PR surface

Tests +30, Other +4. Total +34 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 30 0 +30
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 6 2 +4
Total 2 36 2 +34

Review metrics

Metric Value Why it matters
Production vs test delta production +4 (+6/-2), tests +30 The small production increase enforces the shared child-process exit contract; the added tests need direct assertions before they provide regression coverage.

Stored data model

Persistent data-model change detected: migration/backfill/repair: scripts/install.ps1, migration/backfill/repair: test/scripts/install-ps1.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Add direct assertions for both PowerShell fixtures, then obtain a focused Windows/PowerShell result for the exact head.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Add direct assertions for both PowerShell fixtures, then obtain a focused Windows/PowerShell result for the exact head.

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

Yes, from current source: a nonzero native exit does not throw in the wrapper, and Run-Doctor then prints success unconditionally; this read-only review did not execute Windows PowerShell.

Is this the best way to solve the issue?

Yes for the production repair: the shared command wrapper owns child-process exit semantics, but the PR still needs assertions that exercise both new regression fixtures.

Full review comments:

  • [P2] Assert both added PowerShell regression cases — test/scripts/install-ps1.test.ts:108-135
    The batch runner records fixture exceptions as { ok: false }, and no expectBatchedPowerShellCase call names either new fixture. Consequently both regressions can fail while Vitest passes; add direct assertions for each case.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: A failed Windows migration can be reported as complete, leaving operators with stale settings and no timely recovery signal.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; the supplied focused-test claim is not an observed Windows installer run.

Evidence

What I checked:

  • Current-main defect: Current main still invokes the native command without checking its exit code and prints migration success after an empty catch; the PR head changes both paths. (scripts/install.ps1:873, ea4466e5dce5)
  • Unasserted regression fixtures: Both new fixture failures are converted to stored failed results, while no assertion invokes either fixture, allowing the focused suite to pass despite either regression. (test/scripts/install-ps1.test.ts:108, 4e8a72fc7f64)
  • Prior finding remains unchanged: The affected installer and test files have no diff since the previous reviewed head, so the existing P2 finding remains rather than being a late discovery. (test/scripts/install-ps1.test.ts:556, 4e8a72fc7f64)
  • Current-area provenance: Blame attributes the current wrapper, doctor, and batch-harness boundary to recent installer-area work; the substantive PR change is edef896 from 2026-08-06. (scripts/install.ps1:873, 48ea08918e3f)

Likely related people:

  • steipete: Current-main blame assigns the wrapper, doctor, and batch-harness boundary to this recent installer-area history; the substantive proposed repair is also authored here. (role: recent installer-area contributor; confidence: medium; commits: 48ea08918e3f, edef8963bb56; files: scripts/install.ps1, test/scripts/install-ps1.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add direct assertions for openclaw-native-command-exit and doctor-failure-output.
  • Show the focused test result on a Windows/PowerShell-capable runner after the assertions are added.

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 (1 earlier review cycle)
  • reviewed 2026-08-06T23:27:30.688Z sha a4532ac :: found issues before merge. :: [P2] Assert both added PowerShell regression cases

@steipete
steipete merged commit aa7cf44 into main Aug 7, 2026
240 of 243 checks passed
@steipete
steipete deleted the steipete/install-ps1-doctor-exit branch August 7, 2026 08:20
@steipete

steipete commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 8, 2026
…tion as complete (openclaw#120033)

* fix(install): Windows installer surfaces doctor migration failures

Invoke-OpenClawCommand ignored the child exit code, so a failed
'openclaw doctor --non-interactive' still printed '[OK] Migration complete'.
The wrapper now throws on nonzero exit and Run-Doctor reports the failure
with the exact command to rerun instead of claiming success.

* chore: re-fire CI

* chore: re-fire CI against fixed main baseline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant