Repository navigation
fix: keep the openclaw command and Gateway working after updating a pnpm install - #201735
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR repairs quoted pnpm launchers and preserves Gateway service ownership across package updates. Example: Update a pnpm 12.21.0 installation from OpenClaw 2026.11.5 to the fixed build.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR repairs a concrete pnpm update failure still present on current main. No actionable introduced defect was found; CI remains pending. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe package updater stages and activates pnpm installations, publishes CLI launchers, and reconciles the managed Gateway service; Doctor and Gateway startup also repair launchers left broken by older updaters. flowchart TD
A[OpenClaw update] --> B[Stage pnpm package]
B --> C[Relocate and validate launchers]
C --> D[Activate package and launchers]
D --> E[Revalidate admitted Gateway service]
E --> F[Working CLI and Gateway]
G[Doctor and Gateway startup] --> H[Shared launcher repair]
H --> F
Technical reviewBest possible solution: Retain the shared relocation and repair owner, reject provably broken launchers through existing rollback, and refresh only the unchanged admitted Gateway definition. Do we have a high-confidence way to reproduce the issue? The supplied published-release Docker failures match the current-main parser and lexical-root revalidation paths; this read-only review did not rerun them. Is this the best way to solve the issue? The patch fixes launcher production at the existing relocator, supplies shared candidate-side recovery for older updaters, and preserves the admitted service identity without introducing another lifecycle owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0d4eacf5b9e2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +247, Tests +260. Total +507 across 11 files. Added test files: 2. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 November 19, 2026, 4:06 AM ET / 09:06 UTC. |
…Doctor cannot make
…ge-update-keeps-cli-and-gateway
…ing form relocates
…ATH entries - Resolve pnpm shims from the physical bin directory whenever the shim defines basedir_abs, including the braced form the rewriter emits. - Keep the forward-slash pass for absolute paths in extensionless shims on Windows. - verifyRuntimeLauncher reports an unknown format from its single inspection; the swap turns it into a warning and fails a missing target. - The launcher repair scan skips FIFOs and other special files instead of blocking Doctor or Gateway startup on them. - Docs: automatic launcher repair is macOS and Linux only.
…ge-update-keeps-cli-and-gateway
…ownership on the bytes repaired - The pre-stop guard refuses only launchers the swap publishes; another global package's shim in the staged bin directory no longer fails the OpenClaw update. - A shim resolves physically only when it assigns basedir_abs; a path that merely contains the name no longer switches an older lexical shim to the physical bin directory. - Launcher repair checks cmd-shim-target ownership on the same read it relocates, and leaves the launcher alone if it changed before the rename. - Doctor, Gateway and docs recovery commands use `pnpm add -g --allow-build=openclaw`.
…te launcher tests - A launcher rewritten in place (Doctor and Gateway repair) does not move with its directory, so the stage relocation now applies when the stage sits inside that directory, as with pnpm's home-level shim. The updater relocates between different directories and is unchanged. - Fold the apostrophe-in-stage finalize case into the quoted pnpm 12 layout, the FIFO case into the rewrite cases, the verification cases into one table and the service revalidation cases into one table. Drop the "recorded target missing" refusal: the ownership check now covers it the same way as "another installation". - Record the remaining 21 regression-test lines over the allowance.
…ge-update-keeps-cli-and-gateway
…ery route on refusal - Move resolvePackageUpdateLauncherNames into the leaf module package-update-launcher-names.ts so the native stage no longer imports package-update-filesystem (madge cycle through the swap contract), and list it in the update-restart swap fixture and PR wrapper inventory. - Relocate absolute paths with a replacement callback, so `$'` and similar in a live path stay literal. - The pre-stop refusal names the direct pnpm reinstall, the Gateway reinstall and restart, and openclaw triage.
…ge-update-keeps-cli-and-gateway
|
Merged via squash.
|
…npm install (openclaw#201735) * fix(update): keep the pnpm launcher and Gateway working across a pnpm package update * fix(update): quote repaired pnpm launchers safely and report repairs Doctor cannot make * fix(update): rewrite pnpm launcher words by value so every shell quoting form relocates * fix(update): verify pnpm launchers in one pass and skip non-regular PATH entries - Resolve pnpm shims from the physical bin directory whenever the shim defines basedir_abs, including the braced form the rewriter emits. - Keep the forward-slash pass for absolute paths in extensionless shims on Windows. - verifyRuntimeLauncher reports an unknown format from its single inspection; the swap turns it into a warning and fails a missing target. - The launcher repair scan skips FIFOs and other special files instead of blocking Doctor or Gateway startup on them. - Docs: automatic launcher repair is macOS and Linux only. * fix(update): touch only this installation's pnpm launchers and prove ownership on the bytes repaired - The pre-stop guard refuses only launchers the swap publishes; another global package's shim in the staged bin directory no longer fails the OpenClaw update. - A shim resolves physically only when it assigns basedir_abs; a path that merely contains the name no longer switches an older lexical shim to the physical bin directory. - Launcher repair checks cmd-shim-target ownership on the same read it relocates, and leaves the launcher alone if it changed before the rename. - Doctor, Gateway and docs recovery commands use `pnpm add -g --allow-build=openclaw`. * fix(update): repair a home-level pnpm launcher in place and consolidate launcher tests - A launcher rewritten in place (Doctor and Gateway repair) does not move with its directory, so the stage relocation now applies when the stage sits inside that directory, as with pnpm's home-level shim. The updater relocates between different directories and is unchanged. - Fold the apostrophe-in-stage finalize case into the quoted pnpm 12 layout, the FIFO case into the rewrite cases, the verification cases into one table and the service revalidation cases into one table. Drop the "recorded target missing" refusal: the ownership check now covers it the same way as "another installation". - Record the remaining 21 regression-test lines over the allowance. * fix(update): break the launcher-names import cycle and name the recovery route on refusal - Move resolvePackageUpdateLauncherNames into the leaf module package-update-launcher-names.ts so the native stage no longer imports package-update-filesystem (madge cycle through the swap contract), and list it in the update-restart swap fixture and PR wrapper inventory. - Relocate absolute paths with a replacement callback, so `$'` and similar in a live path stay literal. - The pre-stop refusal names the direct pnpm reinstall, the Gateway reinstall and restart, and openclaw triage.
…npm install (#201735) * fix(update): keep the pnpm launcher and Gateway working across a pnpm package update * fix(update): quote repaired pnpm launchers safely and report repairs Doctor cannot make * fix(update): rewrite pnpm launcher words by value so every shell quoting form relocates * fix(update): verify pnpm launchers in one pass and skip non-regular PATH entries - Resolve pnpm shims from the physical bin directory whenever the shim defines basedir_abs, including the braced form the rewriter emits. - Keep the forward-slash pass for absolute paths in extensionless shims on Windows. - verifyRuntimeLauncher reports an unknown format from its single inspection; the swap turns it into a warning and fails a missing target. - The launcher repair scan skips FIFOs and other special files instead of blocking Doctor or Gateway startup on them. - Docs: automatic launcher repair is macOS and Linux only. * fix(update): touch only this installation's pnpm launchers and prove ownership on the bytes repaired - The pre-stop guard refuses only launchers the swap publishes; another global package's shim in the staged bin directory no longer fails the OpenClaw update. - A shim resolves physically only when it assigns basedir_abs; a path that merely contains the name no longer switches an older lexical shim to the physical bin directory. - Launcher repair checks cmd-shim-target ownership on the same read it relocates, and leaves the launcher alone if it changed before the rename. - Doctor, Gateway and docs recovery commands use `pnpm add -g --allow-build=openclaw`. * fix(update): repair a home-level pnpm launcher in place and consolidate launcher tests - A launcher rewritten in place (Doctor and Gateway repair) does not move with its directory, so the stage relocation now applies when the stage sits inside that directory, as with pnpm's home-level shim. The updater relocates between different directories and is unchanged. - Fold the apostrophe-in-stage finalize case into the quoted pnpm 12 layout, the FIFO case into the rewrite cases, the verification cases into one table and the service revalidation cases into one table. Drop the "recorded target missing" refusal: the ownership check now covers it the same way as "another installation". - Record the remaining 21 regression-test lines over the allowance. * fix(update): break the launcher-names import cycle and name the recovery route on refusal - Move resolvePackageUpdateLauncherNames into the leaf module package-update-launcher-names.ts so the native stage no longer imports package-update-filesystem (madge cycle through the swap contract), and list it in the update-restart swap fixture and PR wrapper inventory. - Relocate absolute paths with a replacement callback, so `$'` and similar in a live path stay literal. - The pre-stop refusal names the direct pnpm reinstall, the Gateway reinstall and restart, and openclaw triage. (cherry picked from commit dbc1aa0) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 176c28c431ce4347520c8483d4c266a9d64482aa)
…aw#194058) Failed-update triage now captures the operator's environment before managed candidate admission, so a coding agent installed only on the operator's PATH is still offered when the Gateway service's PATH differs. Restores the operator-environment contract from openclaw#134490 and keeps the launch confirmation from openclaw#143139. Proof: shipped CLI on isolated Linux (Crabbox) with a running systemd Gateway: accept launches the operator-only agent, decline starts nothing, base 18bee8e reports no agent found; published 2026.11.1 upgrades to the fix with settings intact. Co-authored-by: TorstenW <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: steipete <[email protected]> (cherry picked from commit 7c702c3) Release adaptation: Capture invoking operator env before candidate admission, forward to interactive triage only; preserve latest target selectors, confirmation and lease cleanup ordering. Exact three authorized production paths plus real lifecycle regression. Follow-up dispositions: ad4863d fix: preserve the running installation when an agent updates its Gateway (openclaw#201570); dc73ec0 fix: let updates finish when another tool briefly reads OpenClaw's databases (openclaw#202541); d07b530 fix: clarify PostgreSQL schema upgrades for Git installs (openclaw#202098); e60ea9f test(update): add a Git release upgrade-survivor scenario (openclaw#201956); 2ef6f7b fix(update): build and serve Git releases outside node_modules (openclaw#201917); dbc1aa0 fix: keep the openclaw command and Gateway working after updating a pnpm install (openclaw#201735); f5e7641 fix: Git checkout updates across a schema change no longer end as post-update-failed after the new release starts (openclaw#201600); 2183caf fix: Git checkout updates no longer fail before the new release starts on a schema change or a busy database (openclaw#201463); 47e8649 fix: explain why Doctor cannot restore a scheduled job’s account (openclaw#201550); 8f2cfd4 fix: remove updater-only restrictions from agent maintenance guidance; cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 24cb734 fix: keep carried-over scheduled jobs running after updates (openclaw#200653); d1276e1 feat(doctor): check OpenClaw ID member roles and honor an optional roles default (openclaw#197785); 0a39956 fix: finish updates when another tool reads OpenClaw's databases during the update (openclaw#201330); ea1c9d5 fix(update): settle remounted package publications before admission (openclaw#201336); 66b5212 fix(update): isolate malformed retained-install markers (openclaw#201199); 7e79c83 fix: let the next update finish a killed source checkout update (openclaw#201009); d905d8a fix: let the next update finish a killed update after the machine restarted (openclaw#200994); fdf0c95 fix: let the next update finish a killed update that had already installed the new version (openclaw#200866); 0c19bcd chore(release): close out 2026.11.5 on main (openclaw#200577); a1940e0 fix(matrix): keep explicit recovery available during deferred migration (openclaw#200805); 18b4776 improve: explain package baseline drift during updates (openclaw#200802); 1ad4cad fix(doctor): reclaim macOS updater runtimes blocked by non-updater processes (openclaw#200732); 427c857 fix: keep one missing archived transcript from blocking every update (openclaw#200733); 802e3f7 fix(update): keep valid cold archives from blocking updates (openclaw#200659); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); 3afe212 fix: let Doctor publish unchanged plugin migrations in any order (openclaw#200658); f65e4db fix(doctor): reclaim runtimes blocked by unrelated Linux processes (openclaw#200657); dab086c fix(update): let candidate Doctor read plugin dependencies from the staged package (openclaw#200595); 3447bee fix(update): keep updates going when the predecessor writes during its stop (openclaw#200569); 0ce9c77 fix: let the next update settle a package publication that a killed update left behind (openclaw#200550); ae31ea3 fix(update): repair handoffs in the journal-pinned lease store (openclaw#200532); 74020ea fix: continue updates when initial SQLite capture is stale (openclaw#200328); 6747b1e feat(update): run Git checkout installs from releases behind the release link (openclaw#199706); e3f8a67 fix(state): keep completed retained agent stores out of startup upgrade (openclaw#200284); 3c512c5 fix(gateway): move managed update lease operations off the main thread (openclaw#200169); ea69fcb chore(release): close out 2026.11.4 on main (openclaw#199956); 618bf31 fix(state): bound startup upgrade copies and pruning to owned state (openclaw#199929); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); 5dbf569 fix(update): plugin failures never fail an update or Gateway health; 764761e fix(update): refuse missing host prerequisites in one line and record a cause per attempt; 4c4fef4 fix(ui): update dialog claims installation before progress is confirmed (openclaw#199254); 136e1f6 fix(update): retrying an update from a dev checkout is refused after a killed update (openclaw#198673); 3bd03da fix(update): avoid duplicate database copies while the Gateway is stopped (openclaw#198148); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); e333f7e chore(ci): drop retired test-lines allocation records (3/3) (openclaw#197657); fd6fa47 fix: converge Gateway updates with environment-only service overrides (openclaw#196371); 7cf5e75 fix: clarify split-install updates and blocked Doctor repairs (openclaw#196342); 6ff8c86 fix(update): retain lazy sqlite catalog generation (openclaw#197095); 930e1f7 fix: keep stable updates and recovery free of premature migrations (openclaw#196474); a15f737 fix: preserve external plugin data during update rehearsal (openclaw#196301); 92798ae fix: updates survive interrupted heartbeat runs (openclaw#195656); c1e55e2 fix(update): restore LaunchAgent registration after repair contention (openclaw#195406); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685); 689cfc8 fix(update): reclaim dead closing triage repair leases (openclaw#194503); 86bc89e fix(doctor): keep standing Codex parameter advice out of retirement blockers (openclaw#193650); 691bc8d fix(backup): read the backup engine without copying the live database (openclaw#194234); 000542f fix(backup): backups and updates fail on slow storage when a header probe batch misses its deadline (openclaw#194239); 31a65d5 fix(update): skip --no-lazy-fetch on Git versions without it (openclaw#194198); e45e99d fix(update): preserve dev update sources in tag-only Git clones (openclaw#193109) Validation: Baseline2 intended operator-agent failures/32 controls passed; candidate34/34passed (194058-green.log). Accept launches synthetic operator-only CLI with expected env, decline starts nothing. Isolated updater flow, not live systemd/upgrade qualification. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 6689fd575ada8fe40a9593784deac18ec73041cd) (cherry picked from commit 92e7a9fa223b0dc35801f25f70be90b472d9a6b7)
…leave the Gateway stopped (#205067) Published 2026.11.7, 2026.11.8 and 2026.11.9 ship the same launcher relocation and service revalidation code as 2026.11.6, and none of them contains the pnpm launcher and restart fix (#201735), so a pnpm update they drive still leaves the Gateway stopped. 2026.11.10 carries the fix.
…leave the Gateway stopped (openclaw#205067) Published 2026.11.7, 2026.11.8 and 2026.11.9 ship the same launcher relocation and service revalidation code as 2026.11.6, and none of them contains the pnpm launcher and restart fix (openclaw#201735), so a pnpm update they drive still leaves the Gateway stopped. 2026.11.10 carries the fix.
…leave the Gateway stopped (#205067) Published 2026.11.7, 2026.11.8 and 2026.11.9 ship the same launcher relocation and service revalidation code as 2026.11.6, and none of them contains the pnpm launcher and restart fix (#201735), so a pnpm update they drive still leaves the Gateway stopped. 2026.11.10 carries the fix. (cherry picked from commit 230456c) Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
What Problem This Solves
When OpenClaw was installed with pnpm (
pnpm add -g openclaw), a plainopenclaw updatecould leave the machine with noopenclawcommand and no Gateway. This was measured in real Docker cells updating published 2026.11.4 to published 2026.11.5 with pnpm 11.28.13, 12.15.0 and 12.21.0:openclawcommand failed withCannot find module .../.openclaw-update-native-XXXXXX/.../openclaw.mjs. On 12.15.0 the update even reported success.managed-service-ownership (service-ownership-changed). The Gateway stayed down after the databases had been migrated (state-migrated-no-rollback).User Impact
User impact: pnpm-managed installs update to a working CLI and a Gateway serving the new version. If the published launcher still cannot start the new package after repair, the update fails and the transaction restores the previous launchers instead of reporting success.
Installs already updated by an older updater are repaired by the new package itself. Its Doctor (which runs during the update and on
openclaw doctor) and its Gateway startup rewrite a launcher that provably belongs to this installation and still names a removed update stage, without a user command.Update behavior for published updaters: the installed updater runs the launcher relocation, so 2026.11.4 and 2026.11.5 still publish a launcher that points into their stage when they update to a release with this fix. In the measured first hops (2026.11.4 and 2026.11.5, each to this fix, pnpm 12.21.0), the new package's Doctor repaired that launcher during the same update. Both updaters handed the post-core steps to the new package (
update-driver-handoff), which restarted the Gateway on the new version. Both runs ended with exit 0, a working CLI and the Gateway serving the new version. The service-ownership refusal fired only when the new package lacked the fix (2026.11.4 to public 2026.11.5).Why This Change Was Made
Launcher (A): pnpm writes shims as
exec node "$basedir_abs"/'../global/v11/<group>/node_modules/openclaw/openclaw.mjs' "$@", with the base and the target quoted separately. The relocation pattern only recognized"$basedir_abs/<target>", so the stage-relative target was published unchanged. #170131 fixed the unquoted$basedir_abs/form; the quoted form was never handled. This change:Service (B): before stopping the Gateway, the updater records the service as owned by the lexical pnpm global entry (
global/v11/<group>/node_modules/openclaw). The unit runs the real path that entry resolved to in pnpm's versioned store (store/v11/links/@/openclaw/<old>/...). The swap repoints the entry to the new version. Revalidation's install-root-change check then re-inspected the unchanged unit against that same lexical root, which now means the new version, and found it "foreign". This only happens while the old store directory still exists; when pnpm has pruned it, the existing "unresolved" path already passed. Revalidation now also matches the unchanged definition against its own installation root. The protection is unchanged: the definition fingerprint, service name, profile and manager UID must still be the ones admitted before the stop, so an edited definition, or a service of another installation, is still refused.Evidence
Behavior checked: an ordinary pnpm package update keeps a working CLI and restarts the Gateway on the new version, and an already-broken launcher heals.
Cannot find module '<pnpm-home>/.openclaw-update-native-6MD67E/v11/926ea…/node_modules/openclaw/openclaw.mjs', Gateway down. The same result was measured on 11.28.13; on 12.15.0 the update reported ok and the CLI was broken.1f1a842(relabeled 2026.11.19-beta.1) updated through pnpm 12.21.0 to a newer build of the same code labeled beta.2 (openclaw update --yes --json --tag <tarball>). Exit 0, status ok.openclaw --versionprintsOpenClaw 2026.11.19-beta.2 (1f1a842). The live launcher runs"${basedir_abs}"/../global/v11/926ea…/node_modules/openclaw/openclaw.mjs, and neither it nor NODE_PATH names a stage. The Gateway serves beta.2 with/readyz200, and the service definition was refreshed to the new root. A second update returnedalready-currentwith the CLI and Gateway still working. The final head298d125only adds a merge of two main commits that touch release-validation tooling and docs, so the cell was not rerun for it. The same cell also passed on387a694.2026.11.5installed withpnpm add -gon pnpm 12.21.0, updated to a build of the PR head387a694withopenclaw update --yes --json --tag <tarball>. Exit 0, status ok. Afterwardsopenclaw --versionprintsOpenClaw 2026.11.19-beta.2and the Gateway serves it with/readyz200. A file observer shows the published updater still writing the broken launcher (exec node "$basedir_abs"/'../.openclaw-update-native-WeztE4/v11/…/openclaw.mjs'; its own check only warned, "Published launcher … could not be verified"). Twelve seconds later, during the post-swap Doctor that runs from this head's package, the launcher was rewritten to../global/v11/926ea…/node_modules/openclaw/openclaw.mjs. The Gateway restart did not hit the ownership refusal on this hop, because 2026.11.5 hands the post-core steps to the candidate driver (update-driver-handoff), which contains the revalidation fix. A second update returnedalready-current. The same first hop from published2026.11.4(on the earlier head70e18af) also ended with exit 0, a working CLI and the Gateway serving the new version.update-native-package-stage.test.ts: a pnpm layout with the quoted shim, under a directory namedteam's baseand with NODE_PATH in the stage. On main the published launcher runsModule not found ".../physical/bin/../.openclaw-update-native-…/openclaw.mjs". A second case refuses to finalize anopenclawlauncher that relocation cannot rewrite and leaves another package's shim alone.update-runtime-relocation.test.ts: with a symlinked bin directory, a lexical shim resolves beside the link and a shim that assignsbasedir_absresolves physically.update-command-service-install-root.test.ts: a pnpm versioned-store layout with the old store kept. On main this fails with the exact production error (Required: admitted service ownership owned … detected: foreign). The pruned-store case and two negative controls (another installation, an edited definition) are green on both.package-update-swap.launchers.test.ts: the earlier "commit with a warning" contract for missing launcher targets is replaced by a failed swap that keeps the previous package; an unknown launcher format still commits with the actionable warning.update-launcher-repair.test.ts: the exact shim text from the RED evidence is repaired and executes the live install, including under a global directory namedteam's global(the'\''quoting round-trips and the shim still runs). The same cases run with an apostrophe above the pnpm home and with a directory namedodd "dir" $HOME \ global; a stubnodechecks the exact entry and NODE_PATH. A FIFO namedopenclawon PATH is skipped. The mode is preserved, no staging is left behind, and a second pass leaves the launcher alone. Four cases are left untouched: a live stage (update in progress), another installation's root, a recorded entry that is not the stage's live counterpart, and a stage that is not beside the project. The "another installation" and "stage not beside the project" cases were shown to fail with their guard removed.server-startup-plugins.test.ts: Gateway post-ready maintenance repairs a home-level launcher on PATH that names this installation and a removed stage, and logs the repair.pnpm add -g --allow-build=openclaw [email protected],openclaw gateway install --force,openclaw gateway restart, thenopenclaw gateway status --deepandopenclaw doctor --non-interactive, all exit 0. The CLI and Gateway work afterwards.openclaw update statusstill lists the failed run and an unresolved original-state capture; keep it and the<PNPM_HOME>/.openclaw.package-backup-*directory until Doctor passes.Checks
node scripts/run-vitest.mjson the touched and adjacent files (launcher repair, runtime relocation, native stage, allpackage-update-swap*, runtime path index, service install root, update rollback, Doctor startup, Gateway startup plugins) all pass exceptupdate-command-rollback.test.ts > excludes a competing config writer…. That test asserts a setgid mode bit (expected 504 to be 1528) and fails the same way on main on macOS, a known Mac-only failure. Earlier heads also ran the 75 affected files with the same single exception.pnpm tsgo:core,pnpm tsgo:core:test: pass.oxlinton touched files: clean. Test-lines ratchet: +424 against 400 plus the recorded 24.pnpm check:import-cyclesandpnpm check:madge-import-cycles: 0 cycles.release/2026.11.6(fix(update): keep the openclaw command and Gateway working after a pnpm update #201739) andrelease/2026.11.10(fix(update): keep the openclaw command and Gateway working after a pnpm update #201740).autoreviewdoes not run on this machine.Recordings
Raw terminal recordings of the Docker cells. Each shows the cell log streamed live, then a summary read from the raw cell files. Host paths are replaced with
<proof-dir>; container paths are under/home/appuser.red-2026.11.4-to-2026.11.5-recovery.mp4
1f1a842to head1f1a842.green2-head-to-head-1f1a842.mp4
387a694.green1-published-2026.11.5-to-head-387a694.mp4
Full raw cell logs are not attached, because the Crabbox artifact store rejects uploads from this machine. The decisive lines are quoted above.
Review rounds
Landing review on
387a694found that the launcher rewrite missed pnpm's escaped spelling when the stage path itself contains an apostrophe. With a pnpm home underteam's base/, pnpm writes the stage inNODE_PATHasteam'\''s base/..., and the raw prefix replacement never matched it. The repair then left NODE_PATH on the removed stage but still reported success, and the pre-stop guard would have refused every update on such an install. It also found that the pattern stopped at a"inside a single-quoted target. Both were real and are fixed in3df4ba4. Relocation now parses each shell word, rewrites its value and quotes it again, so every quoting form is handled the same way. Coverage, all red on387a694and green now:odd "dir" $HOME \ global;nodechecks the exact entry path and NODE_PATH the shell passes."Repaired" is reported only when nothing in the launcher still names the stage. The two refusal cases that previously never found a launcher now present one, and each fails when its guard is removed. The private repair directory is removed when the first write fails. Docs now say exactly what the first-hop runs showed.
ClawSweeper round 2 on
3df4ba4rated it overall D / proof C / patch D. All five findings were real and are fixed in8db0790:$basedir_absmatch, which missed the braced${basedir_abs}the rewriter emits. A shim whose bin directory is a symlink would then resolve its target from the wrong parent. Relocation and verification now use the physical bin directory whenever the shim definesbasedir_abs..cmd/.ps1shims.openclawblocked Doctor and Gateway maintenance. It now skips anything that is not a regular file. A new test with a FIFO on PATH times out without the check and passes with it.verifyRuntimeLaunchernow returnsunknown-formatfrom its single read; the swap turns that into the warning and still fails a missing target.ClawSweeper round 3 on
3fdf10a(round 2's fixes merged with main) rated it overall D / proof C / patch D. All four findings were real and are fixed in98bad55:resolvePackageUpdateLauncherNames). A new negative control (other-cli) finalizes; theopenclawcase still refuses. The control fails when the filter is removed.basedir_abs, including a directory name in a path. It now requires the shim to assignbasedir_abs. The new verification test with a lexical shim, a symlinked bin directory and a path that namesbasedir_absfails on the textual check.cmd-shim-targetequals this installation's entry) is now checked inside the repair, on the same bytes it relocates. If the launcher changed before the rename, the repair leaves it alone. That race is not covered by a test.--allow-build=openclaw. The docs, Doctor and Gateway messages now usepnpm add -g --allow-build=openclaw openclaw@<installed-version>, the command the recovery cell ran.Shrinking the Gateway startup test to a home-level layout (
PNPM_HOME/openclawbesidePNPM_HOME/global/) exposed one more gap, fixed in1f1a842. In that layout the stage sits inside the launcher's own directory, and an in-place repair kept the target unchanged, treating it as moving with the directory. A launcher rewritten in place now applies the stage relocation. The updater relocates between different directories and is unchanged. The Gateway test fails without this fix.The same commit consolidates tests:
After that, 24 regression-test lines remain over the 400-line allowance (21 before the landing round). They are recorded in
config/test-lines-allocations/201735-pnpm-update-keeps-cli-and-gateway.txt.ClawSweeper round 1 on
df6345erated it overall F / proof C / patch F. Its findings and the independent reviewer's were all checked and fixed inbc6c5e9:'broke the rewritten single-quoted shim: real. Relocation now decodes and re-encodes'\''both in the exec target and in the NODE_PATH export, and a repaired shim underteam's globalruns.cmd-shim-targetis this installation's entry.mkdtempdirectory beside the launcher and renames from there.Landing round on
298d125The required
check-guards-architecturejob failed on a new import cycle:update-native-package-stage.ts→package-update-filesystem.ts→package-update-swap-contract.ts→ back.resolvePackageUpdateLauncherNamesnow lives in a leaf module,package-update-launcher-names.ts, and all four callers import it from there.pnpm check:madge-import-cyclesreported 1 cycle before and 0 after;pnpm check:import-cyclespasses. The new module is listed in the update-restart swap fixture and in the PR wrapper inventory, and their tests pass.Two smaller fixes from the same round:
replaceAllwith a string replacement, so a$'in the live path was read as a replacement token. A callback replaces it now. The repair quoting case now uses a directory namedodd "dir" $HOME $' \ global; it fails with the string replacement and passes with the callback.openclaw gateway install --forceandopenclaw gateway restart, which is the sequence the recovery cell ran, plusopenclaw triage. The finalize test asserts the full message.No new rating round or Docker cell was run for these. The launcher writer is unchanged except in the
$'case, which has the unit test.Follow-ups (not in this PR)
basedirshim reached through a symlinked bin directory is relocated from the physical directory. The repair then correctly reports it as not repaired (update-launcher-repair.ts, the relocation step) instead of repairing it.PNPM_HOMEset to exercise a real one.Steps left to a person
openclaw triage, because no new code is running there yet. Once this release is installed (for example by the recovery'spnpm add), its Doctor and Gateway repair the launcher themselves.Not proven
.cmd/.ps1quoted forms were not observed; those formats keep the existing behavior.resolvePnpmCommandprefersPNPM_HOME/bin/pnpmover PATH. In these cells no pnpm was installed inPNPM_HOME, so the image's pnpm ran. Every pnpm tried (11.28.13, 12.15.0, 12.21.0) wrote or rewrote the quoted form, so the fix does not depend on the version.