Repository navigation
fix(update): keep the openclaw command and Gateway working after a pnpm update (2026.11.9) - #204716
Conversation
…pm update Port of openclaw#203401 (release/2026.11.7) to release/2026.11.9 as one commit. pnpm 12 global shims are now recognized when the runtime is relocated, a captured worker resolves through the retained updater runtime, the pnpm launcher is repaired for this account only, and when a shipped updater refuses the Gateway restart on a same-schema hop, `update status`, Doctor and Gateway status name the verified recovery (`openclaw gateway install --force`, then `openclaw gateway restart`).
|
🦞👀 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 changes before merge. What this changesBackports launcher relocation, launcher repair, Gateway service revalidation, recovery guidance, and retained worker fixes to release/2026.11.9. Example: A pnpm user updates published OpenClaw 2026.11.8 to a same-schema 2026.11.9 candidate.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored release backport addresses a documented pnpm update failure that remains in published 2026.11.8. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe updater stages and activates package-manager installations, preserves its running worker code, and reconciles the managed Gateway service; Doctor and status commands repair or explain failures left by older updaters. flowchart TD
A[Installed updater] --> B[Native package stage]
B --> C[Launcher relocation and activation]
A --> D[Retained worker runtime]
C --> E[Candidate Doctor]
E --> F[Launcher repair and recovery guidance]
C --> G[Gateway service revalidation]
G --> H[Running Gateway]
Technical reviewBest possible solution: Backport the existing update-owner fixes and extend the first-hop recovery warning through the affected 2026.11.8 release. Do we have a high-confidence way to reproduce the issue? Published-release source retains the quoted-launcher and service-root failures corroborated by the linked production runs; current main already contains their fixes, and no new reproduction was executed during this read-only review. Is this the best way to solve the issue? The patch uses the existing relocation, swap rollback, service admission, and worker-spawn owners; candidate-side launcher repair is justified because an already-installed updater cannot be changed. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7651c99ab73b. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +1109, Tests +957, Docs +31, Other +4. Total +2101 across 33 files. Added test files: 4. 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. 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 24, 2026, 10:30 AM ET / 15:30 UTC. |
… the Gateway stopped Published 2026.11.7, 2026.11.8 and 2026.11.9 ship the same launcher relocation and service revalidation code as 2026.11.6, so a pnpm update they drive to a release with this fix still leaves the Gateway stopped until gateway install --force and gateway restart run.
|
Measured after 2026.11.9 was published: it breaks pnpm installs that update to it, the same way 2026.11.8 did.
The table and decisive lines are in the PR body under "Published 2026.11.9". For the release owner: this PR is the fix if a 2026.11.9-1 correction is cut. It now has two commits (the fix and a docs correction); squash them when picking, the squashed diff applies cleanly at |
|
Closing this one. 2026.11.10 has been npm
|
What Problem This Solves
Fixes: on a pnpm install,
openclaw updateto published 2026.11.8 exits 1, leaves everyopenclawcommand failing withCannot find module …/.openclaw-update-native-…/openclaw.mjs, and leaves the Gateway stopped. Measured today with the real published packages from 2026.11.7 and from 2026.11.6, on pnpm 11.29.0, 12.21.0 and 12.23.0.release/2026.11.9as it stands would repeat it.This is a port of #203401 (open, for
release/2026.11.7) torelease/2026.11.9, proposed for the release owner to pick. 2026.11.8 shipped without that fix: itssrc/infra/update-runtime-relocation.tsandsrc/cli/update-cli/update-command-service-revalidation.tsare byte-identical tov2026.11.7.User Impact
What a pnpm user gets when the next release on this line contains this commit:
openclawcommand keeps working after the update. From published 2026.11.8 and from published 2026.11.7,openclaw --versionprinted the new version right after the update.service-revalidation-failed, exit 1). 2026.11.6, 2026.11.7, 2026.11.8 and this line all have state schema 36 and agent schema 38. Two commands bring the Gateway back:openclaw gateway install --force, thenopenclaw gateway restart. The Doctor note during the update,openclaw update status, andopenclaw gateway status --deepall name them. They took 15 to 16 s.Update behavior: the fix takes effect when this package is the updater, the Doctor, or the Gateway. An update driven by an already shipped 2026.11.7 or 2026.11.8 updater gets the Doctor launcher repair and the new advice, but not the Gateway restart.
Steps still left to a person: only the two Gateway commands, once, on the first update from a shipped pnpm updater. The updater that runs that step is already installed and cannot be changed from here.
openclaw triagenow starts, because the command works, but it cannot restart a user service without a terminal. No step is left after that.Why This Change Was Made
This is one commit with the net change of #203401 (
git diff e0477dd30d3 d499c9539c8). That PR's basee0477dd30d3is an ancestor ofrelease/2026.11.9. Of its 33 files, onlydocs/install/updating.mdhas changed on this line since, and the patch applied there without conflicts. The changed lines of all 33 files are identical to #203401's; I checked this file by file.What it does, as described on #203401:
openclaw triage.Cherry-pick for the release line
release/2026.11.9at0032b1d7ffd. It is version 2026.11.9, with the same schema as 2026.11.6, 2026.11.7 and 2026.11.8.c4c2472fcc1(the fix) and19623728710(docs only: the warning now names 2026.11.4 through 2026.11.9 as updaters that leave the Gateway stopped once). Squash them when picking: the squashed diff applies cleanly atv2026.11.9, and cherry-picking both there gives the same tree as this head. The fix touches only files that exist on this line, plus new files, and depends on no main-only code.Evidence
Published 2026.11.8, real packages from the public registry
Setup. Each cell ran in a Linux container with systemd as PID 1 and the Gateway as a real systemd user service, on Node 24.22.1. It used a 256 MiB agent database with a busy writer and synthetic state. The command was a plain
openclaw update --yes --json. After the update the cell waited 7 min for the Gateway, then ran the printed next step and the recovery.openclawafterMODULE_NOT_FOUNDfailed/service-revalidation-failed; checkmanaged-service-ownership (service-ownership-changed)MODULE_NOT_FOUNDMODULE_NOT_FOUNDMODULE_NOT_FOUNDsucceededOn every pnpm row, the update's next step was "Run
openclaw triage". That command,openclaw update statusandopenclaw gateway status --deepall failed with the sameMODULE_NOT_FOUND. These three commands restored each pnpm row in 17 to 19 s, with the Gateway then serving 2026.11.8:A user already broken on 2026.11.7. pnpm 12.21.0, published 2026.11.6 →
openclaw update --tag 2026.11.7failed the same way. After that,openclaw update --yes --jsonandopenclaw triageboth fail withMODULE_NOT_FOUND, so the user cannot update their way out. The same three commands with@2026.11.8brought them to a working 2026.11.8 in 20 s.After that recovery on published 2026.11.8, the service still names the per-version store path
store/v11/links/@/openclaw/2026.11.8/…. The next pnpm update from it is the "published 2026.11.8 →" row below.Published 2026.11.9, which shipped without this fix (measured November 25)
2026.11.9 became the stable release on November 25. Its update-path files are byte-identical to 2026.11.7 and 2026.11.8, and it breaks pnpm installs that update to it in the same way. Same cell setup as above, with a 512 MiB agent database, pnpm 12.23.0 and the real packages from the public registry (
[email protected], shasumccf1631c141c74b09d6f0c6d641f6c4cf8df2667).openclawafterMODULE_NOT_FOUNDMODULE_NOT_FOUND--channel beta)--channel beta)Decisive lines from the 2026.11.8 → 2026.11.9 run:
The recovery is the three commands above with
[email protected]; afterwardsopenclaw --versionprintedOpenClaw 2026.11.9 (0032b1d)andgateway status --deepshowedRuntime: running,Connectivity check: ok.The two beta rows pass because that update changes the database schema (state 36 to 40, agent 38 to 42), and in that case the installed updater hands the restart to the new package. An update between two versions with the same schema, driven by any updater from 2026.11.4 through 2026.11.9, still fails.
What this means for where the fix goes. This PR is the fix for a
2026.11.9-1correction, if one is cut. It does not apply torelease/2026.11.10as is: cherry-picking it there conflicts indocs/install/updating.md,src/flows/doctor-health-startup.ts,src/infra/package-update-manager-preflight.tsandsrc/infra/worker-cpu.ts. That line already has the launcher repair; a separate port for it is being prepared.This commit, built from
release/2026.11.9These cells ran a local build of
release/2026.11.9plus this commit, served from a registry inside the cell. It was labelled 2026.11.29, and a version-bump-only build of it 2026.11.30, so neither can clash with a real release. Each step's start was a real published package from the public registry. Setup, load and waits were as above.openclawafterservice-revalidation-failed)OpenClaw 2026.11.29 (4a389a7)update status,gateway status --deepand the Doctor note name the two commandsgateway install --force2.7 s,gateway restart11.3 s → serving 2026.11.29OpenClaw 2026.11.29 (4a389a7)After the two commands, the service runs from pnpm's stable
global/v11/<hash>/node_modules/openclawentry instead of the per-version store path.Gateway outage on the first pnpm hop runs from the stop until the user runs the two commands. In the cells that was 723 to 739 s, of which 420 s is the cell's deliberate wait.
Disk. Sampled per directory through the pnpm update from published 2026.11.8, as peak / left afterwards:
Published 2026.11.7 → 2026.11.8 was similar: +818, +534 / +268 and +893 / +623 MiB. These are the cell's own paths, not the shared VM disk.
Harness note. A first run of the published 2026.11.8 → this build cell labelled the build 2026.11.91. Versions with patch 33 or higher belong to the extended-stable line (
src/infra/update-channels.ts:70-78). The bump hop then followedextended-stable(2026.10.33) and was refused by the schema preflight. That was my labelling error, not a product result. The first hop of that run matched the 2026.11.29 run: exit 1, a working command, the Gateway stopped, and the same advice. I reran all port cells as 2026.11.29 / 2026.11.30 and report only those above.Recordings
Each recording replays the cell log as recorded, then facts read from the raw cell files. Container paths are shown under
~.RED: pnpm 12.21.0, published 2026.11.7 → published 2026.11.8:
red-M1r.mp4
GREEN: pnpm 12.21.0, published 2026.11.8 → this build → bump build:
green-P1r.mp4
GREEN: pnpm 12.21.0, published 2026.11.7 → this build → bump build:
green-P2r.mp4
RED, published 2026.11.7 → 2026.11.8 (pnpm 12.21.0): decisive output
GREEN, published 2026.11.8 → this build (pnpm 12.21.0): decisive output
Full raw logs are not attached, because the artifact store rejects uploads from this machine.
Checks on this head
node scripts/run-vitest.mjsonc4c2472, and all pass:update-command-service-install-root(4),update-refused-restart-recovery(27),program-args.pnpm(8),server-startup-plugins(24);package-update-swap.launchers(3),runtime-worker-generation(8),update-global.bun-owner(18);update-launcher-repair(12),update-native-package-stage(9),update-runtime-relocation(2);status.gather(55),update-cli/status(35),doctor-health-startup(8),package-update-filesystem(39).test/scripts/update-restart-module-outcome.test.tsandtest/scripts/eager-import-closure.test.tspass (37 tests).update-runtime-relocation.test.tsfails on0032b1d7ffd(2 of 2) withCannot resolve the launcher's executable target. That is the same advisory the published 2026.11.8 updater prints in the cells.pnpm tsgo:coreandpnpm tsgo:core:testpass.scripts/run-lint.mtsreports no finding in any touched file; the repository-widemax-lineserrors it reports are in untouched files.git diff --checkis clean.docs:check-config-examplespasses with an isolated state directory.docs:check-i18n-glossaryfails ondocs/concepts/decision-models.md, which this PR does not touch.test-lines, which is over by 4285 with this PR's +956 net: the base is already about 3329 over. The PR CI for arelease/*base skips that budget.c4c2472passed every check: 83 pass, 58 skipped.autoreviewdoes not run on this machine. An independent read-only review of this commit found no blocking defect and confirmed that every import resolves on this base. Its should-fix notes apply equally to #203401, and I left them out to keep this a faithful port:openclawon PATH in full;Not proven