Repository navigation
fix(install): upgrade Node when it does not satisfy the target release's engines - #187564
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
There was a problem hiding this comment.
💡 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".
| OPENCLAW_VERSION="$(bounded_probe_output 'beta tag' resolve_beta_version || true)" | ||
| OPENCLAW_VERSION="${OPENCLAW_VERSION:-latest}" | ||
| USE_BETA=0 |
There was a problem hiding this comment.
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 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThe 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe 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
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 523deb354d12. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceTests +80, Docs +2, Other +94. Total +176 across 5 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 29, 2026, 6:13 AM ET / 10:13 UTC. |
…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.
…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.
…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.
…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.
…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.
…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]>
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.1fallback.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.nodebefore choosing Node. Bash uses its existing bounded probe; both npm lookups disable retries and set a five-second fetch timeout. Bash resolves--betabefore 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
https://openclaw.ai/install.shstill used the 24.16.0 floor;npm view openclaw@latest engines.node --fetch-timeout=5000 --fetch-retries=0returned>=24.22.1 <25 || >=26.12.1.node:24.21.0-bookworm, isolated HOME/state, andOPENCLAW_VERSION=2026.10.8: base installer printedNode.js v24.21.0 found, then package preinstall rejected it withthis OpenClaw release requires Node >=24.22.1 <25 || >=26.12.1and installation failed. Candidate installer upgraded through NodeSource to 24.22.2 and printedOpenClaw installed successfully (2026.10.8)!. Both task containers were removed.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).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 basescripts/install.sh:gives a working PATH remedy after a writable npm prefix with quoted prefixandprints 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.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.check:changedSQLite inventory omitted under the local gate budget; targeted checks above provide local proof and PR CI supplies broad 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=1passed 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.test/scripts/package-acceptance-workflow.test.tscasebounds the complete CLI record for 256 real planner groupstook 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.