Repository navigation
fix(update): keep the openclaw command and Gateway working after a pnpm update - #201739
fuller-stack-dev wants to merge 8 commits into
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: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
…Doctor cannot make
…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.
…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.
…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.
Real pnpm update onto this backport head: the CLI works, but the Gateway stays down until the next updateThe cell started from published
What this shows. The launcher half of the fix works on the first hop: the CLI runs 2026.11.6 and the launcher names the live install. The Gateway half does not. The published 2026.11.5 updater refuses to restart the Gateway, and the Gateway stays down until the next Root cause.
This backport cannot fix that hop from the candidate side as it stands. The published updater makes the refusal before any new code gets control. I am reporting this to the release owner and have changed nothing. Recording of the run, with the cell log streamed live and then a summary read from the raw cell files (host paths replaced with bp-pnpm-2026.11.5-to-r6-848912c.mp4The full raw logs are not attached. GitHub's attachment route accepts only media, and the Crabbox artifact store rejects uploads from this machine. The decisive lines follow. First update: failed steps and recovery (raw
|
What this backport fixes today, and what it does not yetAll the cells below start from published OpenClaw installed with pnpm 12.21.0 and the Gateway as a managed service. Each uses a 256 MiB database with a writer, and runs
Fixed by this backport: the Not yet fixed: the Gateway restart on a same-schema hop from 2026.11.5.
Until then, the verified recovery on that hop is a second plain Recording of the 2026.11.4 → bp-pnpm-2026.11.4-to-r6-848912c.mp42026.11.4 →
|
Verified recovery for the same-schema hop from 2026.11.5This was a real cell in the failure state described above: published 2026.11.5 → this PR's head
Shortest working recovery: The automatic fix is the draft #201906 on |
Published 2026.11.6 breaks pnpm installs on updateSetup: published
What 2026.11.5 prints at the end. Both commands it names fail, because the
|
Update: pnpm 11, and the 2026.11.4 startThese cells use the same setup as the comment above: published OpenClaw from the public registry, a plain
pnpm 11 users break the same way, and the same recovery works.
The 2026.11.4 start is the worse state, and the same three steps recover it with the data intact.
Recordings:
pub-pnpm11.28.13-2026.11.5-to-public-2026.11.6.mp4
pub-pnpm-2026.11.4-to-public-2026.11.6-recovery.mp4 |
|
Superseded by #203401, which carries the same change for |
What Problem This Solves
Backport of #201735 (proposal for the release owner; do not merge without the release owner's decision).
On pnpm-managed installs (
pnpm add -g openclaw),openclaw updatecan leave no workingopenclawcommand, because the launcher points into the removed update stage, and on pnpm 11.28/12.21 a Gateway that is refused restart and stays down. This was measured with published 2026.11.4 updating to public 2026.11.5.User Impact
User impact: pnpm installs update to a working CLI and a Gateway that serves the new version. Launchers already broken by an earlier updater are repaired by this release's Doctor and Gateway startup, without a user command.
Why This Change Was Made
This carries the same commits as the main PR, cherry-picked cleanly onto this branch. It relocates and verifies pnpm's quoted shim form (
"$basedir_abs"/'target'). It refuses to finalize a launcher that still names the stage, and fails an update whose published launcher cannot start instead of reporting success. Service revalidation now matches the unchanged definition against its own installation root after pnpm repoints the global entry into its versioned store. The fingerprint, name, profile and manager-UID protection is unchanged.This branch now also includes the apostrophe and quoting fix. Launcher relocation parses each shell word, rewrites its value and quotes it again, so a pnpm home or global directory containing
',",$, a space or a backslash relocates correctly, including pnpm's'\''spelling of the stage inNODE_PATH. A repair reports success only when nothing in the launcher still names the stage. It also includes the later review fixes from the main PR:basedir_abs;pnpm add -g --allow-build=openclaw openclaw@<installed-version>;package-update-launcher-names.ts), so the native stage adds no import cycle;$'in a live path stays literal during relocation;openclaw triage.On this branch the cherry-pick dropped the import change for
package-update-release-switch.ts, which does not exist on 2026.11.6.The main PR lists the remaining follow-ups; they are not part of this backport.
Evidence
release/2026.11.6:node scripts/run-vitest.mjson the launcher repair, runtime relocation, native stage, allpackage-update-swap*, package filesystem, service install root, Gateway startup plugin, update-restart module outcome and eager import closure tests passes (258 tests).pnpm check:import-cyclesandpnpm check:madge-import-cyclesreport 0 cycles, andpnpm tsgo:coreandpnpm tsgo:core:testpass.Not proven
openclaw update→ published 2026.11.6 from the public registry only. The updater installs a registry target in the project-store layout (global/v11/<group>/node_modules/.pnpm/openclaw@<version>…), the same layout class the earlier tarball-target cells used. See fix(update): keep the openclaw command and Gateway working after a pnpm update #201739 (comment).virtualStoreType=projectsetting the updater passes, so its target layout may differ. A pnpm 11 cell is being prepared.