Repository navigation
fix(install): use the git target's own engines instead of the npm fallback floor - #187635
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 Local ClawSweeper was unavailable because the shared runner checkout has unrelated edits. Codex autoreview of this change was scoped-clean at P0–P2; regression, Docker, ratchet, and inherited-failure evidence is in the PR body. |
|
🦞👀 Re-review progress:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3a088cfc9
ℹ️ 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".
| fi | ||
| fi | ||
|
|
||
| ensure_node "$repo_dir" || return 1 |
There was a problem hiding this comment.
Resolve release tags without npm before selecting the checkout
On a fresh host without Node/npm, moving ensure_node after checkout selection makes --install-method git silently install main instead of the default latest release. resolve_git_openclaw_ref in scripts/install-policy.sh still calls installer_npm view openclaw dist-tags.latest and explicitly falls back to main when that command produces no output; explicit next/beta selectors similarly fall through to literal Git refs rather than published release tags. (npm view --help describes the command as “View registry info”.) Previously npm was provisioned before this lookup. Resolve dist-tags through a Node-independent registry lookup before checkout selection so fresh installs retain the requested release while Node admission still uses that checkout’s engines.
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR reads Git checkout engines before admitting or provisioning Node in the Bash and PowerShell installers. Example: Install Git main with Node 24.21.0 and passing SQLite capability checks.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain Keep open: the target-aware admission fix is useful and maintainer-directed, but moving Node setup after checkout introduces bootstrap failures and incorrect release selection. Priority: P2 Before merge
Findings
Provenance
Tests
Agent review detailsHow this fits togetherThe standalone installers turn an installation method and version selector into a checkout or package, select a compatible runtime, build or install OpenClaw, and publish its launcher. flowchart TD
A[Installation request] --> B[Select package or Git checkout]
B --> C[Read target engines]
C --> D[Admit or provision Node]
D --> E[Install dependencies and build]
E --> F[Verify CLI and publish launcher]
Technical reviewBest possible solution: Keep checkout-specific admission in the existing provisioning owners while making preceding checkout preparation and release-tag resolution independent of Node and npm. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the strict fallback leak, and the linked report supplies a real-runtime reproduction; this read-only review executed no installer or tests. Is this the best way to solve the issue? Reading the selected checkout fixes the correct admission owner, but the smallest complete repair must also eliminate Node/npm dependencies before that admission without weakening transactional checkout safety. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 62af09f9ae0c. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceTests +70, Docs 0, Other +21. Total +91 across 5 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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, 8:01 AM ET / 12:01 UTC. |
…ting success (#187688) After #187635 moved runtime admission, ensure_node is called from a conditional, which disables bash's implicit failure handling inside install_homebrew. A failed Homebrew bootstrap therefore printed 'Homebrew installed' and went on to brew install node. The installer now propagates the bootstrap status explicitly through quiet and verbose modes and both installer entry paths, so it stops with the original exit status before any success output or Node provisioning. Fixes #187678. Thanks @McgAtom 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.
…ting success (openclaw#187688) After openclaw#187635 moved runtime admission, ensure_node is called from a conditional, which disables bash's implicit failure handling inside install_homebrew. A failed Homebrew bootstrap therefore printed 'Homebrew installed' and went on to brew install node. The installer now propagates the bootstrap status explicitly through quiet and verbose modes and both installer entry paths, so it stops with the original exit status before any success output or Node provisioning. Fixes openclaw#187678. Thanks @McgAtom for the report.
What Problem This Solves
Fixes #187613, a regression introduced by #187564: git installs unnecessarily provision a newer Node runtime even when the selected source and SQLite checks accept the installed runtime. Thanks @McgAtom for the report and reproduction.
User Impact
Git installs retain Node 24.21.0 for main's relaxed engine range, while older refs with stricter engines still upgrade it. Bash and PowerShell both use the selected checkout's requirement. npm installs continue using the selected package's metadata and conservative fallback.
Why This Change Was Made
The npm fallback remained active for git installs because engine resolution returned early. Runtime admission now happens after the git checkout/ref is selected and before pnpm bootstrap. Bash reads the checkout manifest without requiring Node first; PowerShell uses its built-in JSON reader. The existing Node provisioning and SQLite checks remain the admission owner. Related: #187627 handles main through installer constants; this change reads the actual selected checkout for every ref and includes PowerShell. npm ownership discovery follows successful git installation so it cannot run before git runtime selection.
The simplification moves the existing Node setup into one reusable operation per installer rather than adding another provisioning path. Production: +79/-58 lines (net +21); regression/fixture coverage: +70 lines; docs: +1/-1. No dependencies, options, schemas, or baselines change.
Evidence
node scripts/run-vitest.mjs test/scripts/install-sh.test.ts test/scripts/install-ps1.release.test.ts --maxWorkers=1 --reporter=dot: 266 passed, 3 platform skips, 2 inherited failures; 82.89 seconds wall. PowerShell ran under portable 7.6.9. The separateinstall-ps1.test.tsalso passed in the initial combined run. Native Windows installation remains CI coverage.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). Both reproduce on the untouched base and are already documented in fix(install): upgrade Node when it does not satisfy the target release's engines #187564; they were not masked or claimed passing.node scripts/run-vitest.mjs test/scripts/standalone-installers.test.ts test/scripts/build-and-run-mac.test.ts test/scripts/install-git-ref.test.ts test/scripts/install-bun.test.ts src/install-sh-version.test.ts --maxWorkers=1 --reporter=dot: 196 passed across five files / three shards, 38.71 seconds wall.git diff --check, and madge passed (0 cycles).check:max-lines-ratchet --base 3263a51fc3a7: passed, 404 grandfathered suppressions and 458/458 environment names.check:test-lines-ratchet --base 3263a51fc3a7: passed, 6,266,599 lines; ceiling 6,324,751; slack 58,152. The additional line-cap ratchet passed for both changed source files.check:changedSQLite inventory omitted under the campaign's local gate budget; targeted checks above provide local proof and PR CI supplies broad proof.Live Docker installer proof
All three runs used
node:24.21.0-bookworm, isolated HOME andOPENCLAW_STATE_DIR, and standalone scripts assembled withnode scripts/build-installers.mjs .artifacts/docker-proof/installers.The base standalone installer attempted NodeSource provisioning before selecting the git checkout; an
apt-getadapter recorded and refused package mutation (provisioning-refused:install ... nodejs). The candidate runs used real Node, SQLite, Corepack/pnpm, dependency installation, builds, and installed CLI verification without those adapters.Trusted source snapshots were prepared with
git archive 3263a51fc3a7for main andgit archive v2026.10.8for the stricter release. Each was extracted into an isolated git repository, committed, given its requested branch/tag, and assigned a local self-origin so the real installer exercised ref fetch/checkout without downloading repository history. Both complete installs exited 0; both containers were removed by--rm.Main command inside the container, with
HOME=/proof/home-mainandOPENCLAW_STATE_DIR=/proof/state-main:bash /proof/installers/install.sh --install-method git --version main --git-dir /proof/checkout-main --no-git-update --no-onboard --no-prompt node --version "$HOME/.local/bin/openclaw" --versionObserved:
Node.js v24.21.0 found, no upgrade,OpenClaw installed successfully (2026.10.8)!, caller Node stillv24.21.0, installed wrapper reportsOpenClaw 2026.10.8.Stricter-ref command inside a separate fresh container, with
HOME=/proof/home-strictandOPENCLAW_STATE_DIR=/proof/state-strict:bash /proof/installers/install.sh --install-method git --version v2026.10.8 --git-dir /work/checkout --no-onboard --no-prompt "$HOME/.local/bin/openclaw" --versionObserved: selected
v2026.10.8,Node.js v24.21.0 found, upgrading to a supported version,Node.js v24.22.2 installed, active installer runtime/usr/bin/node,OpenClaw installed successfully (2026.10.8)!, installed wrapper reportsOpenClaw 2026.10.8. The caller shell remains unchanged, while the wrapper binds the selected compatible runtime.