Skip to content

fix(install): fall back to portable Node after package manager failure - #134386

Merged
steipete merged 5 commits into
openclaw:mainfrom
ly85206559:codex/install-node-portable-fallback
Sep 19, 2026
Merged

steipete merged 5 commits into
openclaw:mainfrom
ly85206559:codex/install-node-portable-fallback

Conversation

@ly85206559

@ly85206559 ly85206559 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Related: #133869

What Problem This Solves

Fixes an issue where Windows users with winget, Chocolatey, or Scoop installed could not use the elevation-free portable Node fallback when that package manager failed or installed an unsupported runtime. The installer returned immediately even though its final fallback could still complete the installation.

Why This Change Was Made

The three package-manager attempts now share one guarded install-and-validation helper. A failed or unusable result continues through the supported methods and finally reaches the existing user-local portable Node owner. The portable-bootstrap message and Windows installer documentation now describe both absent and failed package managers accurately.

User Impact

A non-admin, broken, or lagging Windows package manager no longer blocks installation when portable Node can be installed successfully.

Evidence

Real isolated Windows portable-Node recovery trace:

Chocolatey exited with code 1
Chocolatey did not make a supported Node.js runtime available
Downloading Node.js v26.8.1...
Node.js v26.8.1 found
User-local Node.js ready: v26.8.1
result=True
portable path=<isolated temp>\OpenClaw\deps\portable-node\node.exe

The probe removed usable Node directories from process PATH, redirected LOCALAPPDATA to an isolated temporary root, simulated a detected Chocolatey failure, then ran the real metadata lookup, download, extraction, runtime/SQLite validation, and process-PATH recovery. The temporary root was removed afterward.

  • A second PowerShell 5.1/pwsh fixture confirms both engines continue from a failed Chocolatey command to the portable owner.
  • The committed regression proves package-manager validation failure reaches Install-PortableNode; existing winget, Chocolatey, and Scoop success fixtures cover the shared helper.
  • Updated docs/install/installer.md to document the broadened fallback contract.
  • oxfmt and git diff --check passed.
  • Initial fix autoreview was clean (confidence 0.88); fresh commit-scoped autoreview of the consolidation/docs follow-up was clean (confidence 0.91).
  • Exact-head CI for 41386e8c4fa540639035f145ccb4e2cfb3a94a23: all 99 checks completed with no failures; CI gate and Windows installer passed. This supersedes the older CI status and rerun request.
  • Landing review of record: Codex scoped-clean, with no accepted/actionable findings.

ClawSweeper review disposition

The September 19, 2026 19:31 UTC review covers exact head 41386e8c4fa540639035f145ccb4e2cfb3a94a23. It reports no correctness findings, no before-merge requirements, and no Rank-up moves to apply or skip. Its Windows recovery proof is sufficient for this bounded fallback change; it does not claim a real Chocolatey installation failure or a complete OpenClaw installation.

@clawsweeper

clawsweeper Bot commented Aug 31, 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 scripts Repository scripts size: S labels Aug 31, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 19, 2026, 5:35 PM ET / 21:35 UTC (Revision 7).

ClawSweeper review

What this changes

The Windows installer continues through failed or unusable package-manager attempts to its existing portable Node fallback, with matching documentation and regression coverage.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary: current main and the latest release still stop before portable recovery when a detected package manager fails. The bounded Windows recovery proof is sufficient, and no actionable correctness findings remain.

Priority: P0
Reviewed head: 41386e8c4fa540639035f145ccb4e2cfb3a94a23

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable recovery fix with sufficient Windows production-path evidence and useful regression coverage.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The supplied isolated Windows trace exercises Install-Node after an injected Chocolatey failure and reaches real portable metadata retrieval, download, extraction, runtime/SQLite validation, and PATH recovery with result=True; focused fixtures supplement the remaining failure cases.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied isolated Windows trace exercises Install-Node after an injected Chocolatey failure and reaches real portable metadata retrieval, download, extraction, runtime/SQLite validation, and PATH recovery with result=True; focused fixtures supplement the remaining failure cases.
Evidence reviewed 7 items Current-main defect remains: Install-Node still returns false after an unsuccessful detected package manager, preventing the subsequent portable fallback. The three reviewed files have no differences between the pinned base and fetched main.
Latest release retains the failure: The supplied latest-release commit also contains the early false returns after winget, Chocolatey, and Scoop validation failures; this recovery fix is not present there.
Recovery and compatibility boundary: The shared helper catches package-manager failures, refreshes discovery, and requires Check-Node success. All attempts reuse the existing portable installer. Main still bypasses provisioning for supported runtimes, and the separate private Node update path is unchanged.
Findings None None.
Security None None.

How this fits together

The Windows installer ensures a supported Node runtime before installing OpenClaw. Package-manager results pass through runtime validation; portable Node provides recovery when those attempts cannot supply a usable runtime.

flowchart TD
  A[Windows setup] --> B{Supported Node available?}
  B -->|Yes| F[Install OpenClaw]
  B -->|No| C[Try package managers in order]
  C --> D{Runtime validation passes?}
  D -->|Yes| F
  D -->|No| E[Install portable Node]
  E --> G{Runtime validation passes?}
  G -->|Yes| F
  G -->|No| H[Report installation failure]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +150, Docs 0, Other +21. Total +171 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 153 3 +150
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 53 32 +21
Total 3 207 36 +171

Review metrics

Metric Value Why it matters
Production versus regression coverage Production net +21 lines; tests net +150 lines The production growth consolidates guarded recovery for three managers, while the tests exercise failure transitions and final installer refusal.

Technical review

Best possible solution:

Let setup recover automatically through the existing portable Node owner while retaining supported-runtime checks and leaving working installations untouched.

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

Yes, from source: with no supported Node and a detected package manager that leaves validation failing, current main returns before portable recovery. This review did not execute that current-main failure.

Is this the best way to solve the issue?

Yes. The patch repairs the existing provisioning sequence through one shared guard and the existing portable installer without adding settings, download sources, or a competing recovery owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5ca92f8dd27a.

Labels

Label justifications:

  • P0: Affected Windows users cannot complete initial setup through the installer and otherwise need manual runtime installation or technical intervention.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied isolated Windows trace exercises Install-Node after an injected Chocolatey failure and reaches real portable metadata retrieval, download, extraction, runtime/SQLite validation, and PATH recovery with result=True; focused fixtures supplement the remaining failure cases.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied isolated Windows trace exercises Install-Node after an injected Chocolatey failure and reaches real portable metadata retrieval, download, extraction, runtime/SQLite validation, and PATH recovery with result=True; focused fixtures supplement the remaining failure cases.

Evidence

What I checked:

  • Current-main defect remains: Install-Node still returns false after an unsuccessful detected package manager, preventing the subsequent portable fallback. The three reviewed files have no differences between the pinned base and fetched main. (scripts/install.ps1:690, 5ca92f8dd27a)
  • Latest release retains the failure: The supplied latest-release commit also contains the early false returns after winget, Chocolatey, and Scoop validation failures; this recovery fix is not present there. (scripts/install.ps1, ec9c1a13db89)
  • Recovery and compatibility boundary: The shared helper catches package-manager failures, refreshes discovery, and requires Check-Node success. All attempts reuse the existing portable installer. Main still bypasses provisioning for supported runtimes, and the separate private Node update path is unchanged. (scripts/install.ps1:630, 41386e8c4fa5)
  • Windows production-path proof: The captured PR body, sourceRevision 6a642c15050998a526acaa243448db51e21267188fafcb311531024ccb25e598, reports an isolated Windows run with usable Node removed from process PATH and a simulated Chocolatey failure. The real metadata lookup, download, extraction, runtime/SQLite validation, and process-PATH recovery produced Node v26.8.1 and result=True. This proves portable recovery, not an actual Chocolatey installation failure or complete OpenClaw installation.
  • Regression coverage and review continuity: The fixtures cover three managers across nonzero exit, exception, and unsupported-runtime outcomes, subsequent-manager success, and final entrypoint refusal when portable recovery fails. They retain boolean-only results and caller error policy. The earlier fallback-wording finding is resolved in code and documentation; the latest supplied review covered this same head with no findings. (test/scripts/install-ps1.test.ts:878, 41386e8c4fa5)
  • CI scope verified: The Windows installer job succeeded on the reviewed head. Its steps exercise strict option binding and dry-run behavior, so it supplements rather than replaces the separate Windows recovery trace. No target code or tests were executed during this read-only review. (.github/workflows/website-installer-sync.yml:277, 41386e8c4fa5)

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)
  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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 (6 earlier review cycles)
  • reviewed 2026-08-31T18:57:32.242Z sha 1173175 :: needs real behavior proof before merge. :: [P3] Describe the portable fallback accurately
  • reviewed 2026-08-31T20:09:53.868Z sha 0c621e3 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-01T18:22:17.645Z sha 0c621e3 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-08T02:05:16.044Z sha f778b6c :: needs maintainer review before merge. :: none
  • reviewed 2026-09-11T02:22:38.210Z sha b8306aa :: needs maintainer review before merge. :: none
  • reviewed 2026-09-19T19:31:17.603Z sha 41386e8 :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Aug 31, 2026
@ly85206559

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 31, 2026
@ly85206559

ly85206559 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

CI attribution for exact head 0c621e3f21d503c0758a5943b868235d6ea6bd2a:

  • Upstream run 33433768730 is red only because checks-node-compact-large-23 failed two timing-sensitive assertions in untouched src/agents/bash-tools.process.delivery.test.ts.
  • This PR changes only docs/install/installer.md, scripts/install.ps1, and test/scripts/install-ps1.test.ts; its installer proof, exact-range autoreview, and ClawSweeper review are already clean, and the PR retains proof: sufficient / ready for maintainer look.
  • GitHub rejects failed-job reruns for this external contributor account without repository admin rights.

Maintainer action needed: rerun the failed job. I am keeping the exact head unchanged so the accepted proof and review remain attributable.

…rtable-fallback

# Conflicts:
#	docs/install/installer.md
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Sep 8, 2026
…rtable-fallback

# Conflicts:
#	scripts/install.ps1
@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. and removed P1 High-priority user-facing bug, regression, or broken workflow. labels Sep 19, 2026
@steipete
steipete merged commit 216998c into openclaw:main Sep 19, 2026
110 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
openclaw#134386)

Windows installations can now recover automatically when winget, Chocolatey, or Scoop fails or leaves an unsupported Node.js runtime. Guarded package-manager attempts warn and continue through the remaining methods to the existing elevation-free portable Node installer. Runtime validation still gates OpenClaw installation.

The installer remains the sole owner of runtime provisioning. Updated Windows documentation and regression coverage describe and protect failure fallthrough, successful recovery, and final refusal when no usable runtime can be provisioned.

Validation: all 99 exact-head checks completed without failures, including Windows installer CI and openclaw/ci-gate. The isolated Windows recovery trace exercised real portable download, extraction, PATH recovery, and runtime/SQLite validation after an injected Chocolatey failure. Codex review was scoped-clean; ClawSweeper reported no actionable findings or Rank-up moves.

Related: openclaw#133869
RomneyDa added a commit that referenced this pull request Sep 21, 2026
Backport the validated package-manager fallthrough from #134386 and the bounded stale Winget registration repair from #112055.

Co-authored-by: luyifan <[email protected]>
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 P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M 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.

3 participants