Skip to content

fix(install): upgrade Node when it does not satisfy the target release's engines - #187564

Merged
steipete merged 1 commit into
mainfrom
fix/install-target-node-engines-187519
Oct 29, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/install-target-node-engines-187519

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #187519. The hosted installer accepted Node 24.21.0 and then failed installing published releases whose package preinstall requires Node 24.22.1+. Thanks @RomneyDa for the report.

User Impact

Bash and PowerShell installers now upgrade an existing Node runtime when it does not satisfy the selected npm release, using their existing provisioning paths. A satisfying runtime is retained. Metadata lookup failure is a warning and uses the conservative >=24.22.1 <25 || >=26.12.1 fallback.

Why This Change Was Made

The live installer follows main, while installable default releases can retain stricter engines. Runtime admission now reads the selected package's engines.node before choosing Node. Bash uses its existing bounded probe; both npm lookups disable retries and set a five-second fetch timeout. Bash resolves --beta before admission so the same target reaches installation. Existing release-version and SQLite capability checks remain in force. The standalone range grammar mirrors the published preinstall guard's >=floor [<ceiling] alternatives; unavailable or unrecognized metadata falls back to the conservative floor.

The fallback can be lowered once both latest and extended-stable defaults publish relaxed engines. No dependencies, configuration options, schemas, or shared baselines changed. Production: +95/-1 lines (net +94); tests: +80; documentation: +2. The added standalone comparisons are necessary before OpenClaw is installed; existing Node provisioning remains the only upgrade owner.

Evidence

  • Live public checks: https://openclaw.ai/install.sh still used the 24.16.0 floor; npm view openclaw@latest engines.node --fetch-timeout=5000 --fetch-retries=0 returned >=24.22.1 <25 || >=26.12.1.
  • Real local Docker reproduction, starting with node:24.21.0-bookworm, isolated HOME/state, and OPENCLAW_VERSION=2026.10.8: base installer printed Node.js v24.21.0 found, then package preinstall rejected it with this OpenClaw release requires Node >=24.22.1 <25 || >=26.12.1 and installation failed. Candidate installer upgraded through NodeSource to 24.22.2 and printed OpenClaw installed successfully (2026.10.8)!. Both task containers were removed.
  • Live command for each standalone script: docker run --rm -e HOME=/proof/home -e OPENCLAW_STATE_DIR=/proof/state -e OPENCLAW_VERSION=2026.10.8 -e OPENCLAW_NO_PROMPT=1 -e OPENCLAW_NO_ONBOARD=1 -v <isolated-proof-dir>:/proof node:24.21.0-bookworm bash -c 'mkdir -p "$HOME" "$OPENCLAW_STATE_DIR"; bash /proof/install.sh --no-prompt --no-onboard' (base used a separate HOME/state).
  • Regression: six Bash target/fallback cases; three failed on the untouched owner for the intended missing-upgrade behavior and all six pass after repair. Equivalent PowerShell fixture passes under portable PowerShell 7.6.9 on macOS. Native Windows end-to-end installation remains CI coverage.
  • Installer tests: node scripts/run-vitest.mjs test/scripts/install-sh.test.ts test/scripts/install-ps1.release.test.ts test/scripts/install-ps1.test.ts --maxWorkers=1: 277 passed, 4 platform skips, 2 inherited PATH-quoting failures; 63.67 seconds wall. Both failures reproduce against the untouched base scripts/install.sh: gives a working PATH remedy after a writable npm prefix with quoted prefix and prints a literal-safe direct PATH remedy for zsh (unexpected EOF / unmatched quote). Bash test time was 35.55 seconds. No individual test exceeded 30 seconds.
  • Targeted scripts-test tsgo, touched-file oxlint and oxfmt, Bash syntax, git diff --check, and madge passed (0 cycles).
  • check:max-lines-ratchet --base <base> passed: 404 grandfathered suppressions; OPENCLAW env names 458/458. check:test-lines-ratchet --base <base> passed: 6,258,451 lines, ceiling 6,322,981, slack 64,530. Base: 2ce8850303968e74dc9de715cb904d7fb46a735d.
  • Codex autoreview of the complete local change against that base was scoped-clean at P0–P2. Local ClawSweeper was unavailable because its shared runner checkout has unrelated changes; hosted review will be requested once ready.
  • Full check:changed SQLite inventory omitted under the local gate budget; targeted checks above provide local proof and PR CI supplies broad proof.
  • Consumer proof: node scripts/run-vitest.mjs test/scripts/standalone-installers.test.ts test/scripts/install-git-ref.test.ts test/scripts/install-bun.test.ts src/install-sh-version.test.ts --maxWorkers=1 passed all 55 tests across four files / three shards in 23.83 seconds. This covers installer assembly, source/stdin execution, Git ref resolution, the sibling Bun flow, and version extraction.
  • An initial filename-only grep included unrelated workflow/configuration tests. That broader run was stopped, then narrowed to actual installer consumers as above. It completed three unrelated unit files (40 tests), three isolated unit files (41 tests), and the Docker helper file (126 tests, 2 skips) before cancellation, with no failures reported. The pre-existing test/scripts/package-acceptance-workflow.test.ts case bounds the complete CLI record for 256 real planner groups took 61.906 seconds: its real admission path performs 257 planner evaluations. This known pre-existing suite cost is recorded under the campaign's slow-suite exception; it was not changed or claimed as a completed suite.
  • The additional line-cap ratchet passed: 2 changed source files, no new violations or over-cap growth.

…e's engines

Resolve the selected npm package's engines before runtime admission in Bash and PowerShell. Keep a conservative fallback when metadata is unavailable and reuse existing Node provisioning paths.

Fixes #187519. Thanks @RomneyDa for the report.
@clawsweeper

clawsweeper Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: S labels Oct 29, 2026
@steipete
steipete marked this pull request as ready for review October 29, 2026 10:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T10:04:06.855186Z e5dd53c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Oct 29, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5dd53c252

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/install.sh
Comment on lines +1631 to +1633
OPENCLAW_VERSION="$(bounded_probe_output 'beta tag' resolve_beta_version || true)"
OPENCLAW_VERSION="${OPENCLAW_VERSION:-latest}"
USE_BETA=0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve beta selection until npm is available

On a fresh machine without Node/npm, running install.sh --beta now selects latest instead of the available beta. main calls this resolver before provisioning Node, so resolve_beta_version cannot run npm; this block then falls back to latest and clears USE_BETA. Once Node is installed, install_openclaw therefore skips its existing beta resolution and installs stable. Previously that lookup occurred after Node provisioning. Preserve the beta request when npm is unavailable, or resolve it again after provisioning before installing the package.

Useful? React with 👍 / 👎.

@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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

The installers check the selected npm package’s Node requirement before retaining or upgrading the existing runtime.

Example: Install OpenClaw 2026.10.8 with Node 24.21.0 on Debian.

  • Before: The installer accepts Node, then package preinstall rejects it.
  • After: The supplied Docker trace shows Node upgraded to 24.22.2 and OpenClaw installed successfully.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) A useful, focused repair with real Linux installation evidence, two source-verifiable regressions, and incomplete platform and upgrade coverage.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: The installer reports an existing Node runtime as supported, then fails because the selected published OpenClaw package requires a newer runtime.
Reason: The reported failure affects the recommended setup path, and the maintainer-authored direction preserves release-specific requirements without needing a new option.

Merge readiness

⛔ Needs changes before merge - 3 items remain

Keep this PR open: it addresses a verified installation failure, but introduces regressions in fresh beta selection and runtime admission for non-npm installs.

Priority: P0
Reviewed head: e5dd53c2520a98a3020c11cbc0eea8523a1302f9

Before merge

  • Preserve beta intent when npm is not yet available (P2) - On a fresh machine without Node/npm, install.sh --beta reaches this resolver before provisioning. resolve_beta_version cannot invoke npm, so the empty result becomes latest and USE_BETA is cleared. After Node installation, install_openclaw skips its former beta lookup and silently installs stable even when a beta exists. Keep the request pending until npm is available, then resolve the target and its engine before package installation. This independently confirms the earlier review at fix(install): upgrade Node when it does not satisfy the target release's engines #187564 (comment).
  • Limit package-engine enforcement to npm installations (P1) - For --install-method git --version main with SQLite-capable Node 24.21.0, the resolver returns without changing the strict global fallback, but this shared check now rejects the runtime despite main explicitly supporting it. If existing nvm has no newer installed runtime, an unattended installation stops at the provisioning-consent refusal instead of continuing. PowerShell has the same scope leak: Git skips resolution, and -NodeOnly reaches Check-Node through Install-PrivateNode, where an unset engine also becomes the published-package fallback. Apply this additional gate only when admitting a selected npm package; preserve canonical version and SQLite admission for Git and private-runtime operations.
  • Explain or restore the original intent of Runtime compatibility and package-engine admission - 4a5ec82: Restore compatibility below recommended security patch levels while retaining explicit target-package requirements and SQLite checks.

Findings

  • [P2] Preserve beta intent when npm is not yet available — scripts/install.sh:1631-1633
  • [P1] Limit package-engine enforcement to npm installations — scripts/install.sh:1660-1662

Provenance

  • Runtime compatibility and package-engine admission changes intended behavior without addressing why it exists (4a5ec82: Restore compatibility below recommended security patch levels while retaining explicit target-package requirements and SQLite checks.)

Tests

  • Missing end-to-end proof: The supplied evidence does not demonstrate an existing-install upgrade from latest stable with settings intact or native Windows target-engine provisioning.
Agent review details

How this fits together

The hosted Bash and PowerShell installers select a runtime before installing OpenClaw; package engine metadata now feeds their existing Node provisioning paths alongside version and SQLite capability checks.

flowchart TD
  A[Installer options] --> B[Select package target]
  B --> C[Read Node engine metadata]
  C --> D[Check existing runtime]
  D --> E[Existing Node provisioning]
  D --> F[Install OpenClaw]
  E --> F
Loading

Technical review

Best possible solution:

Apply target-package admission only to npm installation, preserve beta intent until resolution can succeed, and retain the existing provisioning and SQLite owners.

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

The source establishes both introduced regressions, and the supplied Docker trace establishes the original published-package mismatch; this read-only review executed no installer or tests.

Is this the best way to solve the issue?

Checking the selected package’s requirements is the right boundary, but enforcing its fallback in shared runtime admission changes unrelated Git and private-runtime contracts.

Full review comments:

  • [P2] Preserve beta intent when npm is not yet available — scripts/install.sh:1631-1633
    On a fresh machine without Node/npm, install.sh --beta reaches this resolver before provisioning. resolve_beta_version cannot invoke npm, so the empty result becomes latest and USE_BETA is cleared. After Node installation, install_openclaw skips its former beta lookup and silently installs stable even when a beta exists. Keep the request pending until npm is available, then resolve the target and its engine before package installation. This independently confirms the earlier review at fix(install): upgrade Node when it does not satisfy the target release's engines #187564 (comment).
    Confidence: 0.99
  • [P1] Limit package-engine enforcement to npm installations — scripts/install.sh:1660-1662
    For --install-method git --version main with SQLite-capable Node 24.21.0, the resolver returns without changing the strict global fallback, but this shared check now rejects the runtime despite main explicitly supporting it. If existing nvm has no newer installed runtime, an unattended installation stops at the provisioning-consent refusal instead of continuing. PowerShell has the same scope leak: Git skips resolution, and -NodeOnly reaches Check-Node through Install-PrivateNode, where an unset engine also becomes the published-package fallback. Apply this additional gate only when admitting a selected npm package; preserve canonical version and SQLite admission for Git and private-runtime operations.
    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 medium; reviewed against 523deb354d12.

Provenance checked

  • Existing nvm provisioning and consent keeps the original intent (0749882: Retain compatible installed runtimes and require consent before provisioning through an existing nvm.)
  • Bash beta selection ordering changes intended behavior with a stated reason (unknown: The verified base resolves beta after Node provisioning; the PR explains moving resolution earlier to align engine admission with installation, but the original introduction was not established by the history search.)
  • SQLite capability admission keeps the original intent (bf6f74b: Require actual lossless SQLite round trips and safe loaded SQLite rather than trusting version labels alone.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • bash -n scripts/install.sh
  • node scripts/run-vitest.mjs test/scripts/install-sh.test.ts test/scripts/install-ps1.release.test.ts test/scripts/install-ps1.test.ts --maxWorkers=1
  • node scripts/run-vitest.mjs test/scripts/standalone-installers.test.ts test/scripts/install-git-ref.test.ts test/scripts/install-bun.test.ts src/install-sh-version.test.ts --maxWorkers=1
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 0749882 adds scripts/install.sh:2213 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 07498821897f; files: scripts/install.sh)
  • RoboClaw: Raw commit 4a5ec82 adds scripts/install.sh:76 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4a5ec828b19c; files: scripts/install.sh)
  • Vincent Koc: Raw commit f33ab24 adds scripts/install.sh:1650 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: f33ab243cf82; files: scripts/install.sh)

PR surface

Tests +80, Docs +2, Other +94. Total +176 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 80 0 +80
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 2 95 1 +94
Total 5 177 1 +176

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +95/-1; tests +80/-0 Standalone engine comparison is justified before OpenClaw exists, and the patch reuses provisioning owners; the added regressions exercise target-engine and fallback decisions in both scripts.

Labels

Label changes:

  • add P0: The underlying default installation failure blocks first useful setup after accepting Node and leaves users needing manual runtime repair.
  • add merge-risk: 🚨 compatibility: The new unconditional fallback rejects runtimes intentionally supported for Git installation and private Node provisioning.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P0: The underlying default installation failure blocks first useful setup after accepting Node and leaves users needing manual runtime repair.
  • merge-risk: 🚨 compatibility: The new unconditional fallback rejects runtimes intentionally supported for Git installation and private Node provisioning.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 29, 2026, 6:13 AM ET / 10:13 UTC.

@steipete
steipete merged commit 5598c3d into main Oct 29, 2026
196 of 198 checks passed
@steipete
steipete deleted the fix/install-target-node-engines-187519 branch October 29, 2026 10:22
steipete added a commit that referenced this pull request Oct 29, 2026
…lback floor (#187635)

#187564 made the installers honor the target release's engines.node, but git installs never resolved one and kept the conservative npm fallback floor, so a Git main install upgraded a Node 24.21.0 that main accepts. Bash and PowerShell installers now read the selected checkout's engines.node after ref selection and before pnpm; npm installs keep the published package's engines. Docker proof: git main retains Node 24.21.0, git v2026.10.8 upgrades to 24.22.2.

Fixes #187613. Thanks @McgAtom for the report.
steipete added a commit that referenced this pull request Oct 30, 2026
…ing stable (#188005)

#187564 made the installers resolve the target release's engines through npm, but on a host without Node the beta tag lookup ran before npm existed, so install.sh --beta switched the target to latest and cleared the beta request, silently installing stable. The installer now keeps the beta request through Node provisioning, resolves the beta tag afterwards, checks the selected package's engines, and warns visibly before falling back to latest when no beta exists. The PowerShell installer refreshes engines after provisioning too.

Fixes #187982. Thanks @McgAtom for the report.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 30, 2026
…e's engines (openclaw#187564)

The installers lowered their Node floor with main's engines before packages with the relaxed engines shipped, so an existing Node 24.16-24.22.0 was accepted and npm install then failed in preinstall. install.sh and the PowerShell installer now check the target release's engines.node before accepting the existing Node, upgrade through the existing provisioning paths when it is unsatisfied, and fall back to the conservative floor with a warning when the lookup fails. Live Docker proof: Node 24.21.0 upgraded to 24.22.2 and installed 2026.10.8.

Fixes openclaw#187519. Thanks @RomneyDa for the report.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 30, 2026
…lback floor (openclaw#187635)

openclaw#187564 made the installers honor the target release's engines.node, but git installs never resolved one and kept the conservative npm fallback floor, so a Git main install upgraded a Node 24.21.0 that main accepts. Bash and PowerShell installers now read the selected checkout's engines.node after ref selection and before pnpm; npm installs keep the published package's engines. Docker proof: git main retains Node 24.21.0, git v2026.10.8 upgrades to 24.22.2.

Fixes openclaw#187613. Thanks @McgAtom for the report.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 30, 2026
…ing stable (openclaw#188005)

openclaw#187564 made the installers resolve the target release's engines through npm, but on a host without Node the beta tag lookup ran before npm existed, so install.sh --beta switched the target to latest and cleared the beta request, silently installing stable. The installer now keeps the beta request through Node provisioning, resolves the beta tag afterwards, checks the selected package's engines, and warns visibly before falling back to latest when no beta exists. The PowerShell installer refreshes engines after provisioning too.

Fixes openclaw#187982. Thanks @McgAtom for the report.
RomneyDa added a commit that referenced this pull request Nov 17, 2026
…ing stable (#188005)

#187564 made the installers resolve the target release's engines through npm, but on a host without Node the beta tag lookup ran before npm existed, so install.sh --beta switched the target to latest and cleared the beta request, silently installing stable. The installer now keeps the beta request through Node provisioning, resolves the beta tag afterwards, checks the selected package's engines, and warns visibly before falling back to latest when no beta exists. The PowerShell installer refreshes engines after provisioning too.

Fixes #187982. Thanks @McgAtom for the report.
(cherry picked from commit 6c4a948)

Co-authored-by: RomneyDa <[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 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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: S 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.

Installer accepts Node 24.16–24.22.0 but every published package requires >=24.22.1

1 participant