Skip to content

fix(install): publish git checkouts without Node before it is provisioned - #195382

Merged
roboclaw-bot merged 1 commit into
openclaw:mainfrom
wr-web:fix/install-git-clone-without-node
Nov 8, 2026
Merged

roboclaw-bot merged 1 commit into
openclaw:mainfrom
wr-web:fix/install-git-clone-without-node

Conversation

@wr-web

@wr-web wr-web commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #195366

What Problem This Solves

install.sh --install-method git fails on any host that does not already have Node. clone_git_checkout_transactionally in scripts/install-policy.sh published the staging clone with node - …, but the git path only provisions Node later, in ensure_node "$repo_dir", which needs the checkout's engines. The clone completed, publication hit node: command not found, the staging checkout was deleted, and every retry downloaded it again.

User Impact

On a fresh Debian/LXC or macOS host with no Node, the git install now publishes the checkout and goes on to provision Node as the npm path does. The user no longer gets a misleading "inspect the destination for partial files" error after a full clone.

Why This Change Was Made

Publication is now a small shell function, publish_git_clone_staging, with the same contract as the old Node script:

  • Fresh target: the target is refused with "Git install dir appeared while cloning" if anything appeared there during the clone; otherwise the staging dir is renamed into place.
  • Existing empty target dir: the dir must still hold only the staging entry. Entries move with .git last, and the staging dir is removed afterwards.
  • Failure: on a failed move, the moved entries roll back. If rollback also fails, the staging dir is renamed to .recovery with the same "recovery files remain" message.

Node bootstrap ordering is unchanged, because the target-engine phase still needs the cloned package.json. install-cli.sh shares this function through the same policy include.

Evidence

Full installer on fresh Debian 13 without Node

This is the assembled-installer run the review asked for. It ran in an isolated WSL Debian GNU/Linux 13 (trixie) as root, where command -v node and command -v npm both print nothing. The command was bash install.sh --install-method git --no-onboard --no-prompt, using the scripts/install.sh and scripts/install-policy.sh pair from each revision.

debian proof

run result
main 772657222638, fresh host The clone completed, then failed with install-policy.sh: line 518: node: command not found and "Could not publish the cloned checkout: /root/openclaw". /root/openclaw does not exist afterwards, and the script still exits 0.
this branch, fresh host The checkout was published and ref main checked out. Then: "Node.js not found, installing it now", "Node.js v24.22.2 installed" via NodeSource, pnpm 12.15.0 via Corepack, dependencies installed, UI and OpenClaw built, wrapper installed. openclaw --version prints OpenClaw 2026.11.1 (51b8257). Total time 9m40s.
this branch, rerun on that install After openclaw config set gateway.port 28799, the rerun reports "Existing OpenClaw installation detected, upgrading". It reuses /root/openclaw (no clone, so the publisher is not involved) and checks out v2026.11.2 with a clean tree. gateway.port: 28799 is still in ~/.openclaw/openclaw.json. That rerun's doctor refused because the state DB schema 39 was written by the newer main build and is newer than the schema 22 that 2026.11.2 supports, and the 2026.11.2 UI build failed on a packaged knowledge manifest. Both are release-state outcomes outside this change.

Publisher-level runs (Git Bash)

proof

run (PATH without node, real git clone of a local repo) main 772657222638 this branch ba5cc37f0ba4
fresh target path install-policy.sh: line 518: node: command not found, rc=1, no checkout rc=0, checkout at HEAD, no staging left
existing empty target dir same failure rc=0, checkout at HEAD, no staging left
target dir appears during clone (existing fixture) refused, user file kept refused, user file kept, staging cleaned by cleanup_tmpfiles

Tests:

  • New test: test/scripts/install-sh.test.ts "publishes Git clones before Node is provisioned ([Bug]: install.sh --install-method git fails on hosts without Node: clone publish step runs node before ensure_node #195366)". It shadows node with a failing function, then publishes both a fresh target and an empty existing dir. Its shell body passes in Git Bash. Vitest's runInstallShell spawns /bin/bash, which does not exist on this Windows host, so the bash-based install tests can't run here in Vitest.
  • Existing fixture: createInstallGitCloneFixtureScript ("publishes fresh Git clones only after success…") passes in Git Bash. The symlink-alias step needs symlink privileges this host lacks.
  • Checks: bash -n scripts/install-policy.sh, oxfmt --check and check:test-lines-ratchet pass.
  • Pre-existing Windows failures: standalone-installers.test.ts fails 6/6 identically on main and on this branch here (symlinks and /bin/bash).

…oned

The git install path provisions Node after cloning, but the staging checkout was published with a Node script, so hosts without Node failed with 'node: command not found' and lost the clone. Publish with shell moves, keeping the appeared-target refusal, .git-last ordering and rollback.
@clawsweeper

clawsweeper Bot commented Nov 8, 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 Nov 8, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 8, 2026
@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Replaces Node-dependent Git checkout publication with shell operations so installation can provision Node afterward.

Example: Run bash install.sh --install-method git --no-onboard --no-prompt on Debian 13 without Node.

  • Before: Cloning finishes, publication fails with node: command not found, and the staging checkout is deleted.
  • After: The checkout is published, Node v24.22.2 is provisioned, and the installed openclaw command runs.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused repair with inspected installer-entry-point proof, useful regression coverage, successful exact-head CI, and no actionable defects; no persisted format changes or migration are introduced.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected Debian 13 terminal screenshot exercises the changed shared publisher through install.sh with Node initially absent, showing base failure and patched publication, runtime provisioning, builds, wrapper installation, and working CLI output. The reported existing-install rerun bypasses publication, preserves gateway.port 28799, and encounters later downgrade/build failures outside this change; the earlier review's requested installer proof is addressed.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A supported fresh-host Git installation fails after cloning because Node is required before the installer provisions it.
Reason: The repair restores documented automatic runtime provisioning without adding options, changing defaults, or introducing another installation owner.

Merge readiness

✅ Ready for maintainer review

Keep open for merge: this PR fixes a current fresh-host installation failure, preserves the existing publication contract, and has no actionable findings.

Priority: P1
Reviewed head: ba5cc37f0ba4d0598bf675266ae498da9dcb6391

Before merge

None.

Findings

None.

Agent review details

How this fits together

Both Unix installer profiles share the clone publisher, which turns a successful staging clone into the configured checkout before ref selection, runtime admission, and builds.

flowchart LR
  A[Unix installer] --> B[Clone into staging]
  B --> C[Shared shell publisher]
  C --> D[Select checkout ref]
  D --> E[Provision compatible Node]
  E --> F[Build and install CLI]
Loading

Technical review

Best possible solution:

Merge the shared shell publisher while retaining checkout-specific Node admission and the existing transactional safeguards.

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

Fetched-main source establishes the missing-Node publication failure, and the contributor's inspected Debian screenshot confirms it through the installer entry point; no target code was executed during this review.

Is this the best way to solve the issue?

Removing the premature runtime dependency in the existing shared publisher is the smallest complete repair and avoids undoing intentional checkout-specific engine selection.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 465c110e4975.

Provenance checked

  • Transactional Git clone publication keeps the original intent (fix(install): avoid unusable checkout directories after failed clones #124872: Publish only successful clones, preserve existing destinations, and avoid leaving commitless checkout directories after failure.)
  • Shared installer policy keeps the original intent (4874680: Consolidate duplicated installer policy while retaining profile-specific runtime selection and failure handling.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 4874680 adds scripts/install-policy.sh:218 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 48746800b018; files: scripts/install-policy.sh)

PR surface

Tests +26, Other +1. Total +27 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 26 0 +26
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 53 52 +1
Total 2 79 52 +27

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: Fresh Git installations on supported hosts without Node fail before runtime provisioning and discard the completed clone.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-08T20:04:31.736Z sha ba5cc37 :: needs real behavior proof before merge. :: none

Reviewed November 8, 2026, 4:16 PM ET / 21:16 UTC (Revision 2).

@wr-web

wr-web commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Added the full assembled-installer proof the review asked for, run on an isolated fresh Debian 13 host without Node. On main it fails at line 518 with node: command not found. On this branch it publishes the checkout, provisions Node v24.22.2, builds, and openclaw --version works. A rerun reuses the same checkout and keeps the settings. Details are in the PR body.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 8, 2026
@roboclaw-bot
roboclaw-bot merged commit 75c2c49 into openclaw:main Nov 8, 2026
160 of 164 checks passed
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Thanks @wr-web, merged as 75c2c49. The fresh no-Node Debian proof made this an easy call.

We also reviewed it independently against main's Node publisher, one behavior at a time. The parts that matter all hold: .git still moves last, a failed move still rolls back, and an existing checkout is never removed. It isn't in a release yet; it ships with the next one.

steipete added a commit that referenced this pull request Nov 8, 2026
#195382 left main 19 lines over the test-lines ceiling, so every PR that
adds tests failed the ratchet. Grant exactly the inherited debt.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 9, 2026
…oned (openclaw#195382)

The git install path provisions Node after cloning, but the staging checkout was published with a Node script, so hosts without Node failed with 'node: command not found' and lost the clone. Publish with shell moves, keeping the appeared-target refusal, .git-last ordering and rollback.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 9, 2026
openclaw#195382 left main 19 lines over the test-lines ceiling, so every PR that
adds tests failed the ratchet. Grant exactly the inherited debt.
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Nov 23, 2026
…oned (openclaw#195382)

The git install path provisions Node after cloning, but the staging checkout was published with a Node script, so hosts without Node failed with 'node: command not found' and lost the clone. Publish with shell moves, keeping the appeared-target refusal, .git-last ordering and rollback.

(cherry picked from commit 75c2c49)
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit ab6a9ef71d9ca4f66f88b2d787cabceea11c9420)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 High-priority user-facing bug, regression, or broken workflow. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

[Bug]: install.sh --install-method git fails on hosts without Node: clone publish step runs node before ensure_node

2 participants