Skip to content

fix(install): recover Windows Node setup after package-manager failures - #154487

Merged
RomneyDa merged 1 commit into
extended-stable/2026.8.33from
backport/windows-update-fallback
Sep 21, 2026
Merged

RomneyDa merged 1 commit into
extended-stable/2026.8.33from
backport/windows-update-fallback

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Related: #134386
Related: #112055

What Problem This Solves

Fixes an issue where Windows users updating from older OpenClaw releases could not complete setup when Winget, Chocolatey, or Scoop failed, left an unsupported Node.js runtime, or retained a stale Winget Node registration.

Why This Change Was Made

Backports the validated package-manager fallthrough from #134386 and the bounded stale-Winget repair from #112055 onto extended-stable/2026.8.33. Each manager result is validated through the existing Node/SQLite probe; failures continue to the next provider and existing portable Node owner. Only Winget's documented 0x8A15002B result triggers one exact-ID repair attempt, and failed or unsupported repair still reaches the validated fallback path.

The implementation is branch-native and does not import later private-Node or installer architecture from main.

User Impact

Windows upgrades can recover without elevation when a detected package manager fails or leaves Node unusable. Machines with a stale MSI/WiX Winget registration get one bounded repair attempt; all other failure shapes retain the existing portable/manual recovery behavior.

Original implementation and intent are credited to @ly85206559 (#134386) and @ooiuuii (#112055).

Evidence

  • Frozen base: f2c4101babbe0bad8046d03185f9b47784c7f07f (extended-stable/2026.8.33).
  • Pre-fix regression: node scripts/run-vitest.mjs test/scripts/install-ps1.test.ts failed because Chocolatey validation returned False before portable recovery; the stale-Winget fixture likewise could not reach repair.
  • Post-fix focused proof: the same command passes 43 tests (1 platform-only skip), including successful package-manager paths, failed/unsupported fallthrough, exact stale-Winget repair, failed-repair portable recovery, and final Node validation.
  • PowerShell parser: PSParser.Tokenize reports no errors.
  • Changed-surface proof: node scripts/check-changed.mjs --staged passed all selected formatting, type, lint, dependency, and repository guards.
  • Fresh autoreview: scoped-clean, no accepted/actionable findings; overall correctness 0.99.
  • Dependency contract: Microsoft WinGet defines 0x8A15002B as APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE; the documented repair command supports --id, --exact, --source, and agreement flags. WinGet's pinned repair source routes MSI/WiX installs through ProductCode-backed MsiExec repair. Unsupported/non-repairable packages still fail into the existing portable fallback.
  • Production delta: scripts/install.ps1 +69/-32 (net +37), required to consolidate three duplicated manager branches behind one validate-and-fall-through owner and add one bounded repair capability. Tests are +55/-2; docs +1/-1.
  • Real Windows proof: exact-head Website Installer Sync run 35566679601, windows-installer job 106229796081 passed on windows-latest, exercising the installer with both Windows PowerShell 5.1 and pwsh.

Upstream sources:

Backport the validated package-manager fallthrough from #134386 and the bounded stale Winget registration repair from #112055.

Co-authored-by: Ben.Li <[email protected]>

Co-authored-by: luyifan <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 21, 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.

@RomneyDa
RomneyDa marked this pull request as ready for review September 21, 2026 06:00
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: S maintainer Maintainer-authored PR labels Sep 21, 2026
@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 21, 2026, 2:10 AM ET / 06:10 UTC.

ClawSweeper review

What this changes

The Windows installer continues past failed or unusable package-manager installations, attempts one narrowly targeted Winget repair, and retains portable Node recovery, with matching tests and documentation.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this remains a useful extended-stable backport despite both upstream fixes being merged on main. No blocking code defect was found; qualification of the backport’s Windows recovery and upgrade behavior remains incomplete.

Priority: P0
Reviewed head: 4bc8d10aedd7fac04a4fe7b04a6c06f79cc23d10

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, coherent backport with useful regression fixtures and no identified code defect; Windows upgrade qualification remains material before landing.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor proof gate is exempt for this MEMBER-authored PR. Its exact-head Windows job proves parsing and dry-run behavior; upstream native recovery evidence covers different candidates, leaving the separately noted release-branch upgrade qualification gap.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate is exempt for this MEMBER-authored PR. Its exact-head Windows job proves parsing and dry-run behavior; upstream native recovery evidence covers different candidates, leaving the separately noted release-branch upgrade qualification gap.
Evidence reviewed 10 items Pinned backport scope: The introduced delta is confined to installer recovery, its PowerShell fixtures, and the Windows installer documentation. Live GitHub metadata confirms that the destination is extended-stable/2026.8.33, not main, and the reviewed head remains unchanged.
Owner boundary and sibling paths: Main calls Check-Node, then Install-Node, and checks Node again before package installation. All three package-manager branches now share validation and fallthrough; the repair checks its captured exit code and runtime validity. The existing portable download, extraction, PATH, and final-failure owners remain in place. The neighboring Git bootstrap similarly validates its portable result before proceeding.
Current main already contains the upstream logic: Current main contains the shared package-manager helper and bounded Winget repair. History identifies the merged upstream work at #134386 and #112055. These establish useful backport provenance, not redundancy on the separate release branch.
Findings None None.
Security None None.

How this fits together

The Windows installer prepares Node.js before installing or upgrading OpenClaw. It checks the runtime and embedded SQLite, tries available package managers, and either proceeds with a usable runtime or reports recovery instructions.

flowchart TD
  A[Windows setup or upgrade] --> B[Check Node and SQLite]
  B -->|Usable| F[Install OpenClaw]
  B -->|Unusable| C[Try package managers]
  C -->|Stale Winget registration| D[One exact package repair]
  C -->|Failed or unsupported| E[Portable Node recovery]
  D -->|Failed or unsupported| E
  C -->|Validated runtime| F
  D -->|Validated runtime| F
  E --> G[Validate runtime or report failure]
  G -->|Usable| F
Loading

Before merge

  • Resolve merge risk (P1) - Recovery now reaches registered-Node repair and portable PATH changes during upgrades, but the supplied exact-head Windows smoke does not establish fresh-install recovery or preservation of existing Node/npm/PATH state on this release branch.
  • Complete next step (P2) - Provide Windows fresh-install and existing-install recovery evidence for the backport, including final Node/SQLite validation and preservation of npm/PATH state; identify the linked dry-run job as smoke coverage.
Agent review details

Security

None.

PR surface

Tests +53, Docs 0, Other +37. Total +90 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 55 2 +53
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 69 32 +37
Total 3 125 35 +90

Review metrics

Metric Value Why it matters
Production versus test growth Production net +37; tests net +53; docs net 0 Production growth adds one bounded repair capability while consolidating three duplicated validation branches; no separate recovery implementation is introduced.

Merge-risk options

Maintainer options:

  1. Qualify the release-branch recovery path (recommended)
    Provide Windows evidence for fresh setup and existing-install recovery, including failed repair reaching portable Node and preservation of npm and PATH state.

Technical review

Best possible solution:

Retain the consolidated recovery owner and bounded Winget repair, with Windows qualification showing the stable branch recovers while preserving existing installation state.

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

Yes, from source on the pinned release-branch base: an available package manager followed by a failed Node check returns false before portable recovery. Current main already fixes this path; no runtime reproduction was executed in this review.

Is this the best way to solve the issue?

Yes, the owner-level consolidation is the appropriate backport shape: it reuses existing validation and portable recovery instead of importing main's broader private-Node architecture. Native qualification of the branch-specific result remains outstanding.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0af08749bb4a.

Labels

Label changes:

  • add P0: The affected stable installer can block setup or upgrades and leave users needing manual Node installation to continue.
  • add merge-risk: 🚨 compatibility: Previously terminating upgrade paths can now repair registered Node or activate portable Node, requiring evidence that existing installation state remains usable.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary external-contributor proof gate is exempt for this MEMBER-authored PR. Its exact-head Windows job proves parsing and dry-run behavior; upstream native recovery evidence covers different candidates, leaving the separately noted release-branch upgrade qualification gap.

Label justifications:

  • P0: The affected stable installer can block setup or upgrades and leave users needing manual Node installation to continue.
  • merge-risk: 🚨 compatibility: Previously terminating upgrade paths can now repair registered Node or activate portable Node, requiring evidence that existing installation state remains usable.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary external-contributor proof gate is exempt for this MEMBER-authored PR. Its exact-head Windows job proves parsing and dry-run behavior; upstream native recovery evidence covers different candidates, leaving the separately noted release-branch upgrade qualification gap.

Evidence

What I checked:

  • Pinned backport scope: The introduced delta is confined to installer recovery, its PowerShell fixtures, and the Windows installer documentation. Live GitHub metadata confirms that the destination is extended-stable/2026.8.33, not main, and the reviewed head remains unchanged. (scripts/install.ps1:552, 4bc8d10aedd7)
  • Owner boundary and sibling paths: Main calls Check-Node, then Install-Node, and checks Node again before package installation. All three package-manager branches now share validation and fallthrough; the repair checks its captured exit code and runtime validity. The existing portable download, extraction, PATH, and final-failure owners remain in place. The neighboring Git bootstrap similarly validates its portable result before proceeding. (scripts/install.ps1:2115, 4bc8d10aedd7)
  • Current main already contains the upstream logic: Current main contains the shared package-manager helper and bounded Winget repair. History identifies the merged upstream work at fix(install): fall back to portable Node after package manager failure #134386 and fix(install): repair stale Winget Node registrations #112055. These establish useful backport provenance, not redundancy on the separate release branch. (scripts/install.ps1, 0af08749bb4a)
  • Release and target-base behavior: Both the pinned extended-stable base and the v2026.9.5 installer return false immediately after an unusable package-manager result, preventing portable recovery. The release source was inspected through GitHub after the local historical blob read failed. (scripts/install.ps1, ec9c1a13db89)
  • Regression coverage: The changed fixtures execute Install-Node with substituted package commands and runtime probes. They assert portable fallthrough after unusable Chocolatey output, exact Winget repair arguments, successful repair without fallback, failed repair reaching portable recovery, and a single Boolean result. Existing sibling fixtures cover Winget discovery and Chocolatey/Scoop success. The body reports 43 passing tests and one platform skip; this read-only review did not rerun them. (test/scripts/install-ps1.test.ts:645, 4bc8d10aedd7)
  • Affirmative dependency signal and repair contract: The introduced installer command directly executes winget repair. The pinned RepairCommand implementation accepts ID, exact matching, source, and both agreement options; RepairFlow dispatches MSI/WiX repair through its MSI owner and rejects unsupported installed types. This agrees with Microsoft's documented repair options: https://learn.microsoft.com/en-us/windows/package-manager/winget/repair. (src/AppInstallerCLICore/Commands/RepairCommand.cpp:15, 36a563143707)

Likely related people:

  • ly85206559: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • ooiuuii: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

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

  • Attach redacted Windows recovery results for this backport, including fresh setup and preservation of existing Node/npm/PATH state during failed-repair fallback.

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.

@RomneyDa
RomneyDa merged commit 85e4359 into extended-stable/2026.8.33 Sep 21, 2026
85 of 132 checks passed
@RomneyDa
RomneyDa deleted the backport/windows-update-fallback branch September 21, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S 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