Skip to content

fix: remove the updater copies that earlier releases leave behind after an update - #206124

Merged
fuller-stack-dev merged 2 commits into
openclaw:mainfrom
fuller-stack-dev:fix/shipped-updater-runtime-reclaim
Nov 26, 2026
Merged

fuller-stack-dev merged 2 commits into
openclaw:mainfrom
fuller-stack-dev:fix/shipped-updater-runtime-reclaim

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Related: #204775

What Problem This Solves

Every update run by a published OpenClaw (2026.11.5 through 2026.11.10) leaves a copy of the running updater in an openclaw-update-runtime-XXXXXX folder, 0.6 to 3.7 GiB each. Cleanup recognized such a folder only through the path of the installation that is running now. pnpm global installs put every update in a new directory, and Git installs move into release folders, so after the first such update the folder no longer matched. It stayed forever, and every update and every openclaw doctor --fix printed Runtime retained at <path>: no recognized runtime marker; inspect it before manual cleanup. A live macOS instance (Git install) holds two of these, 7.4 GB in total.

User Impact

The first update, or the first openclaw doctor --fix, after this release removes these folders by itself. Nothing to do by hand. A folder with this name that OpenClaw did not create is still left alone, and the message now says why without asking for routine work: it does not match a runtime an OpenClaw updater created, so it is kept.

Why This Change Was Made

The fix stays in the existing owner, maintainRetainedUpdateRuntimes in src/infra/temp-artifact-cleanup.ts. The update command's pre-pass, the update's Doctor pass and openclaw doctor --fix all call it. No new owner, config option, retention period or stored field.

Proof of ownership for a folder without owner.json:

  • the name pattern, a real directory owned by this user, and not registered by a running update in this process (unchanged checks);
  • exactly three entries: retained-files.json, a real tree/ directory and update-native-gate.mjs;
  • the first path in retained-files.json is an absolute, normalized .../package.json (the shipped writer lists the retained package.json first), and its projection under tree/ is an openclaw package.json that resolves to itself, so no symbolic link anywhere in the chain;
  • only then the unchanged custody checks run: the identity recheck, the maintenance fence, and the process census with creatorExited: false. Any running OpenClaw command that could be an updater keeps the folder; a Gateway or another non-updater process does not.

Deletion keeps the existing fs.rm, which removes a symbolic link without following it, and a symlinked tree/ never passes recognition anyway.

git log -S'no recognized runtime marker' shows the refusal was deliberate (#160164, then #203917). #203917 handled the moved installation by reclaiming before the first release update starts, and documented manual removal for anything it missed. That pre-pass cannot help a folder whose installation had already moved, or one an earlier hop left behind. That was every pnpm update in the cells below, and both folders on the live instance. The safety concern behind the refusal, that an older updater could still be loading from the folder, is still handled by the census rule above.

Update behavior

  • Shipped drivers that leave these folders: every published release from 2026.11.5 through 2026.11.10 (all write retained-files.json, tree/ and update-native-gate.mjs; none writes owner.json, which exists only on main since fix(update): reclaim abandoned updater runtimes on a busy host #202590). 2026.11.4 and earlier leave a tree/-only folder; this change does not recognize that shape after a move (see "Not proven").
  • When they go away after updating to a release with this fix, with no manual step:
    • During the update that installs the fixed release, its Doctor recognizes them but keeps them, because the driving openclaw update (an older updater) is still running. This is the conservative rule above.
    • The next openclaw update (driven by the fixed release) removes them, or any openclaw doctor --fix before that. Shown for pnpm in cells UG2 and UG1 below. Git and other prepared-release installs reach the same function through the update command's pre-pass; that path was not run in a cell.
  • A failed or kept cleanup never changes the update's outcome (unchanged).

Evidence

Cells: a macOS 27.2 arm64 VM, pnpm 12.23.0 global install, a launchd Gateway serving with a 530 MiB agent database under steady writes, readiness polled every 250 ms. Each cell: install published 2026.11.9, openclaw update --yes --json to published 2026.11.10 (driver 2026.11.9), add two decoy folders with the same name prefix, openclaw update --yes --json to the candidate (driver 2026.11.10), openclaw gateway restart, openclaw doctor --fix --non-interactive. Candidates are packs under the unpublished version 2026.11.13 (2026.11.14 for the third hop).

Cell Candidate After the update After Gateway restart After doctor --fix
UR1, UR2 (red) origin/main 541ebfbbe75 2 shipped runtimes kept, no recognized runtime marker same same: 1,331,336 KiB in 2 folders, warning printed for all 4 folders
UG1 (green) 25365490c2f (this fix) both recognized, kept because the driving openclaw update is still running (PIDs named) same both removed, decoys kept with the new message; folders total 16 KiB
UG2 (green, no manual step) 25365490c2f, then plain openclaw update to the PR head 5ea717d987b as UG1 the next update removed both (Removed abandoned updater runtime: …), decoys kept
  • Disk: the two folders list 1,331,336 KiB. On this pnpm layout, 2026.11.9's folder is mostly hard links into the pnpm store (25,680 KiB only-copy). 2026.11.10's folder is entirely only-copy (666,808 KiB), so about 0.67 GiB of real space comes back here. A Git checkout keeps no other link to the replaced files, so its folders are close to entirely only-copy.
  • Not serving (250 ms probe): red update to main 86.5 s and 101.8 s; green update 85.0 s and 87.9 s; green next update (UG2 u3) 9.3 s; gateway restart 7.5 s in all; doctor --fix 36.7 s red and 42.4 s green (it stops the Gateway for maintenance either way). Update wall time: red 214.7 s and 276.8 s, green 222.6 s and 214.9 s.
  • The Runtime retained lines in the Gateway log come from the update and Doctor processes writing to the shared log. A gateway restart added none on either build.
  • Live instance check (read only): both folders hold exactly retained-files.json, tree/ (only 2f) and update-native-gate.mjs, no owner.json; the file list starts with the old checkout's package.json, and its projection is an openclaw package.json. The running Gateway now runs from a Git release folder, so the projection no longer matched the running root.

Red recording (UR2, origin/main 541ebfbbe75), live view of the cell's output:

red-UR2.mp4

Green recording (UG1, 25365490c2f), doctor --fix removes both:

green-UG1.mp4

Green recording (UG2), the next plain update removes both:

green-UG2.mp4

Repeat: build a pack of each revision under an unpublished version (node scripts/package-openclaw-for-docker.mjs), serve it as the registry inside a disposable VM, and run the steps above. The listing per folder is du -sk, its entries, and the size of files with link count 1.

Raw log excerpt, cell UR2
$ grep '^== ' cell.log   # UR2
== install exit=0 ms=14794
== gateway-install exit=0 ms=2476
== snapshot before: ready=yes cli=OpenClaw 2026.11.9 (0032b1d); lastRun {"reason":null}
== u1 exit=0 ms=169326
== snapshot after-u1: ready=yes cli=OpenClaw 2026.11.10 (6ea542f); lastRun {"runId":"630d7e23-75a5-4f0e-b290-7d10386f9f66","status":"succeeded","phase":"finished","reason":null,"trigger":"cli"}
== u2 exit=0 ms=214651
== snapshot after-u2: ready=yes cli=OpenClaw 2026.11.13 (541ebfb); lastRun {"runId":"3b4e5864-58c7-4d40-a6a0-d217bf57d33a","status":"succeeded","phase":"finished","reason":null,"trigger":"cli"}
== gateway-restart exit=0 ms=9974
== doctor-fix exit=0 ms=47251
--- u1: retained-runtime lines printed by `openclaw update --yes --json` (unique)
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-UwX3o5: no recognized runtime marker; inspect it before manual cleanup
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-UwX3o5: worker generation settled; cleanup deferred to the next eligible update or openclaw doctor --fix
--- u2: retained-runtime lines printed by `openclaw update --yes --json` (unique)
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: no recognized runtime marker; inspect it before manual cleanup
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: no recognized runtime marker; inspect it before manual cleanup
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-UwX3o5: no recognized runtime marker; inspect it before manual cleanup
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-zGMREu: no recognized runtime marker; inspect it before manual cleanup
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-zGMREu: worker generation settled; cleanup deferred to the next eligible update or openclaw doctor --fix
--- runtimes-after-hops
--- runtimes at 2026-11-26T19:46:35Z (after-hops)
4 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1 entries: notes.txt  owner.json:no only-copy KiB: 4
12 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2 entries: retained-files.json tree update-native-gate.mjs  owner.json:no only-copy KiB: 12
  file list starts: ["/Users/admin/other/package.json"]
  tree: 2f 
664528 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-UwX3o5 entries: retained-files.json tree update-native-gate.mjs  owner.json:no only-copy KiB: 25680
  file list starts: ["/Users/admin/Library/pnpm/store/v11/links/@/openclaw/2026.11.9/0a2f611830e35237e5aa4411d711e406aed5ace678b4144fbce6d528840b5fca/node_modules/openclaw/package.
  tree: 2f 
666808 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-zGMREu entries: retained-files.json tree update-native-gate.mjs  owner.json:no only-copy KiB: 666808
  file list starts: ["/Users/admin/Library/pnpm/global/v11/706-18ebafa15ad7dbb0-0/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_m
  tree: 2f 
total KiB: 1331352
/dev/disk4s1s1   111432616 13431788  69234204    17%  486809 692342040    0%   /
--- gateway-restart-messages
Runtime retained lines in Gateway logs: before restart 14, 30 s after ready 14
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-UwX3o5: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-UwX3o5: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-UwX3o5: worker generation settled; cleanup deferred to the next eligible update or openclaw doctor --fix
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-UwX3o5: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-UwX3o5: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-zGMREu: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-UwX3o5: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-zGMREu: no recognized runtime marker; inspect it before manual cleanup
--- runtimes-after-doctor
--- runtimes at 2026-11-26T19:48:08Z (after-doctor)
4 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1 entries: notes.txt  owner.json:no only-copy KiB: 4
12 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2 entries: retained-files.json tree update-native-gate.mjs  owner.json:no only-copy KiB: 12
  file list starts: ["/Users/admin/other/package.json"]
  tree: 2f 
664528 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-UwX3o5 entries: retained-files.json tree update-native-gate.mjs  owner.json:no only-copy KiB: 25680
  file list starts: ["/Users/admin/Library/pnpm/store/v11/links/@/openclaw/2026.11.9/0a2f611830e35237e5aa4411d711e406aed5ace678b4144fbce6d528840b5fca/node_modules/openclaw/package.
  tree: 2f 
666808 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-zGMREu entries: retained-files.json tree update-native-gate.mjs  owner.json:no only-copy KiB: 666808
  file list starts: ["/Users/admin/Library/pnpm/global/v11/706-18ebafa15ad7dbb0-0/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_m
  tree: 2f 
total KiB: 1331352
/dev/disk4s1s1   111432616 13431788  65814892    17%  486809 658148920    0%   /
--- openclaw doctor --fix --non-interactive: 'Updater runtimes' note

◇  Updater runtimes ─────────────────────────────────────────────╮
│                                                                │
│  Runtime retained at                                           │
│  /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: no  │
│  recognized runtime marker; inspect it before manual cleanup   │
│  Runtime retained at                                           │
│  /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: no  │
│  recognized runtime marker; inspect it before manual cleanup   │
│  Runtime retained at                                           │
│  /Users/admin/ocp-work/tmp/openclaw-update-runtime-UwX3o5: no  │
│  recognized runtime marker; inspect it before manual cleanup   │
│  Runtime retained at                                           │
│  /Users/admin/ocp-work/tmp/openclaw-update-runtime-zGMREu: no  │
│  recognized runtime marker; inspect it before manual cleanup   │
│                                                                │
Raw log excerpt, cell UG1
$ grep '^== ' cell.log   # UG1
== install exit=0 ms=14612
== gateway-install exit=0 ms=2739
== snapshot before: ready=yes cli=OpenClaw 2026.11.9 (0032b1d); lastRun {"reason":null}
== u1 exit=0 ms=159901
== snapshot after-u1: ready=yes cli=OpenClaw 2026.11.10 (6ea542f); lastRun {"runId":"98f99d7b-5f20-49b7-98bf-b2dd30506dc2","status":"succeeded","phase":"finished","reason":null,"trigger":"cli"}
== u2 exit=0 ms=222590
== snapshot after-u2: ready=yes cli=OpenClaw 2026.11.13 (2536549); lastRun {"runId":"f0c4bf59-b513-4436-b425-0cb4e82e1d3f","status":"succeeded","phase":"finished","reason":null,"trigger":"cli"}
== gateway-restart exit=0 ms=9790
== doctor-fix exit=0 ms=49188
--- u1: retained-runtime lines printed by `openclaw update --yes --json` (unique)
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV: no recognized runtime marker; inspect it before manual cleanup
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV: worker generation settled; cleanup deferred to the next eligible update or openclaw doctor --fix
--- u2: retained-runtime lines printed by `openclaw update --yes --json` (unique)
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: it does not match a runtime an OpenClaw updater created, so it is kept
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: no recognized runtime marker; inspect it before manual cleanup
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: it does not match a runtime an OpenClaw updater created, so it is kept
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: no recognized runtime marker; inspect it before manual cleanup
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-MQ1oUl: other OpenClaw processes are still running (PIDs: 7567, 5754, 5752); let these holders finish, then rerun openclaw doctor --fix
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-MQ1oUl: other OpenClaw processes are still running (PIDs: 8771, 7567, 5754, 5752); let these holders finish, then rerun openclaw doctor --fix
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-MQ1oUl: worker generation settled; cleanup deferred to the next eligible update or openclaw doctor --fix
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV: no recognized runtime marker; inspect it before manual cleanup
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV: other OpenClaw processes are still running (PIDs: 7567, 5754, 5752); let these holders finish, then rerun openclaw doctor --fix
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV: other OpenClaw processes are still running (PIDs: 8771, 7567, 5754, 5752); let these holders finish, then rerun openclaw doctor --fix
--- runtimes-after-hops
--- runtimes at 2026-11-26T19:28:52Z (after-hops)
4 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1 entries: notes.txt  owner.json:no
12 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2 entries: retained-files.json tree update-native-gate.mjs  owner.json:no
  file list starts: ["/Users/admin/other/package.json"]
  tree: 2f 
666808 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-MQ1oUl entries: retained-files.json tree update-native-gate.mjs  owner.json:no
  file list starts: ["/Users/admin/Library/pnpm/global/v11/6d1-18ebaea9f58189c0-0/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_m
  tree: 2f 
664528 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV entries: retained-files.json tree update-native-gate.mjs  owner.json:no
  file list starts: ["/Users/admin/Library/pnpm/store/v11/links/@/openclaw/2026.11.9/0a2f611830e35237e5aa4411d711e406aed5ace678b4144fbce6d528840b5fca/node_modules/openclaw/package.
  tree: 2f 
total KiB: 1331352
/dev/disk4s1s1   111432616 13431788  69240332    17%  486809 692403320    0%   /
--- gateway-restart-messages
Runtime retained lines in Gateway logs: before restart 14, 30 s after ready 14
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV: worker generation settled; cleanup deferred to the next eligible update or openclaw doctor --fix
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV: no recognized runtime marker; inspect it before manual cleanup
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: it does not match a runtime an OpenClaw updater created, so it is kept
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: it does not match a runtime an OpenClaw updater created, so it is kept
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-MQ1oUl: other OpenClaw processes are still running (PIDs: 7567, 5754, 5752); let these holders finish, then rerun openclaw doctor --fix
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV: other OpenClaw processes are still running (PIDs: 7567, 5754, 5752); let these holders finish, then rerun openclaw doctor --fix
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: it does not match a runtime an OpenClaw updater created, so it is kept
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: it does not match a runtime an OpenClaw updater created, so it is kept
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-MQ1oUl: other OpenClaw processes are still running (PIDs: 8771, 7567, 5754, 5752); let these holders finish, then rerun openclaw doctor --fix
gateway log: Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV: other OpenClaw processes are still running (PIDs: 8771, 7567, 5754, 5752); let these holders finish, then rerun openclaw doctor --fix
--- runtimes-after-doctor
--- runtimes at 2026-11-26T19:30:24Z (after-doctor)
4 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1 entries: notes.txt  owner.json:no
12 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2 entries: retained-files.json tree update-native-gate.mjs  owner.json:no
  file list starts: ["/Users/admin/other/package.json"]
  tree: 2f 
total KiB: 16
/dev/disk4s1s1   111432616 13431788  65836184    17%  486809 658361840    0%   /
--- openclaw doctor --fix --non-interactive: 'Updater runtimes' note

◇  Updater runtimes ──────────────────────────────────────────────────────╮
│                                                                         │
│  Runtime retained at                                                    │
│  /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: it does not  │
│  match a runtime an OpenClaw updater created, so it is kept             │
│  Runtime retained at                                                    │
│  /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: it does not  │
│  match a runtime an OpenClaw updater created, so it is kept             │
│  Removed abandoned updater runtime:                                     │
│  /Users/admin/ocp-work/tmp/openclaw-update-runtime-MQ1oUl               │
│  Removed abandoned updater runtime:                                     │
│  /Users/admin/ocp-work/tmp/openclaw-update-runtime-Q1jhKV               │
│                                                                         │
Raw log excerpt, cell UG2
$ grep '^== ' cell.log   # UG2
== install exit=0 ms=13806
== gateway-install exit=0 ms=2423
== snapshot before: ready=yes cli=OpenClaw 2026.11.9 (0032b1d); lastRun {"reason":null}
== u1 exit=0 ms=162146
== snapshot after-u1: ready=yes cli=OpenClaw 2026.11.10 (6ea542f); lastRun {"runId":"41d7df49-8ea0-4318-99e6-0c01b90b7e40","status":"succeeded","phase":"finished","reason":null,"trigger":"cli"}
== u2 exit=0 ms=214847
== snapshot after-u2: ready=yes cli=OpenClaw 2026.11.13 (2536549); lastRun {"runId":"b25d8238-edfe-48c8-b3a6-e8b9871ca7f1","status":"succeeded","phase":"finished","reason":null,"trigger":"cli"}
== u3 exit=0 ms=120417
== snapshot after-u3: ready=yes cli=OpenClaw 2026.11.14 (5ea717d); lastRun {"runId":"702f711e-d36b-47fe-a0ed-e7dc17ed294d","status":"succeeded","phase":"finished","reason":null,"trigger":"api"}
== gateway-restart exit=0 ms=9521
== doctor-fix exit=0 ms=40910
--- u2: retained-runtime lines printed by `openclaw update --yes --json` (unique)
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-3GhWgb: other OpenClaw processes are still running (PIDs: 7436, 5788, 5786); let these holders finish, then rerun openclaw doctor --fix
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-3GhWgb: other OpenClaw processes are still running (PIDs: 8718, 7436, 5788, 5786); let these holders finish, then rerun openclaw doctor --fix
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-3GhWgb: worker generation settled; cleanup deferred to the next eligible update or openclaw doctor --fix
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-92Z6oi: no recognized runtime marker; inspect it before manual cleanup
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-92Z6oi: other OpenClaw processes are still running (PIDs: 7436, 5788, 5786); let these holders finish, then rerun openclaw doctor --fix
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-92Z6oi: other OpenClaw processes are still running (PIDs: 8718, 7436, 5788, 5786); let these holders finish, then rerun openclaw doctor --fix
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: it does not match a runtime an OpenClaw updater created, so it is kept
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: no recognized runtime marker; inspect it before manual cleanup
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: it does not match a runtime an OpenClaw updater created, so it is kept
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: no recognized runtime marker; inspect it before manual cleanup
--- u3: retained-runtime lines printed by `openclaw update --yes --json` (unique)
Removed abandoned updater runtime: /Users/admin/ocp-work/tmp/openclaw-update-runtime-3GhWgb
Removed abandoned updater runtime: /Users/admin/ocp-work/tmp/openclaw-update-runtime-92Z6oi
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1: it does not match a runtime an OpenClaw updater created, so it is kept
Runtime retained at /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2: it does not match a runtime an OpenClaw updater created, so it is kept
--- runtimes-before-u3
--- runtimes at 2026-11-26T20:03:28Z (before-u3)
666808 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-3GhWgb entries: retained-files.json tree update-native-gate.mjs  owner.json:no only-copy KiB: 666808
  file list starts: ["/Users/admin/Library/pnpm/global/v11/6cd-18ebb08d67e5e6c0-0/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_m
  tree: 2f 
664528 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-92Z6oi entries: retained-files.json tree update-native-gate.mjs  owner.json:no only-copy KiB: 25680
  file list starts: ["/Users/admin/Library/pnpm/store/v11/links/@/openclaw/2026.11.9/0a2f611830e35237e5aa4411d711e406aed5ace678b4144fbce6d528840b5fca/node_modules/openclaw/package.
  tree: 2f 
4 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1 entries: notes.txt  owner.json:no only-copy KiB: 4
12 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2 entries: retained-files.json tree update-native-gate.mjs  owner.json:no only-copy KiB: 12
  file list starts: ["/Users/admin/other/package.json"]
  tree: 2f 
total KiB: 1331352
/dev/disk4s1s1   111432616 13431788  69084144    17%  486809 690841440    0%   /
--- runtimes-after-hops
--- runtimes at 2026-11-26T20:05:49Z (after-hops)
4 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1 entries: notes.txt  owner.json:no only-copy KiB: 4
12 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2 entries: retained-files.json tree update-native-gate.mjs  owner.json:no only-copy KiB: 12
  file list starts: ["/Users/admin/other/package.json"]
  tree: 2f 
total KiB: 16
/dev/disk4s1s1   111432616 13431788  65168428    18%  486809 651684280    0%   /
--- runtimes-after-doctor
--- runtimes at 2026-11-26T20:07:09Z (after-doctor)
4 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy1 entries: notes.txt  owner.json:no only-copy KiB: 4
12 KiB /Users/admin/ocp-work/tmp/openclaw-update-runtime-Decoy2 entries: retained-files.json tree update-native-gate.mjs  owner.json:no only-copy KiB: 12
  file list starts: ["/Users/admin/other/package.json"]
  tree: 2f 
total KiB: 16
/dev/disk4s1s1   111432616 13431788  64600100    18%  486809 646001000    0%   /

Tests

Audited the whole of src/flows/doctor-retained-runtime.test.ts and src/infra/temp-artifact-cleanup.test.ts (cases, fixtures, helpers, mocks, teardown, skips).

  • Added shippedRuntime() fixture: a folder as 2026.11.5 through 2026.11.10 write it, whose retaining pnpm install directory no longer exists.
  • New Doctor and a shipped updater's runtime when …: removed when the installation moved (preview without --fix keeps it and names openclaw doctor --fix); kept, with every entry and the target still readable, when an operator file sits beside it, when its file list names another package, when the file list path leaves the tree, and when tree/ is a symbolic link.
  • Doctor with a live … now runs for both runtime kinds against the real census: a live Gateway does not keep a shipped runtime; a title-erased CLI that may be its updater does.
  • Two existing assertions now expect the new message text; their cases are unchanged.
  • No removals. Nothing was redundant or vacuous.
  • Red on unmodified origin/main (541ebfbbe75): 9 failed. Two are behavior failures (shipped runtime kept despite only a Gateway running, and kept after the installation moved). Seven fail only on the message text; the folder was kept in those cases on both builds. Green on the fix: 31/31 and 1 passed, 1 skipped (Linux-only case) in the two files.

Commands

  • node scripts/run-vitest.mjs src/flows/doctor-retained-runtime.test.ts src/infra/temp-artifact-cleanup.test.ts: red 9 failed / 22 passed on the original owner; green 31 passed, 1 passed + 1 skipped.
  • node scripts/check-changed.mjs -- <changed files>: typecheck lanes passed; it reported the test's recursive readdir (fixed), and the dead-export scan named two exports in src/agents that this PR does not touch.
  • node --import ./scripts/tsx.mjs scripts/check-session-identity-ratchet.mts --base origin/main --no-merge-base: OK.
  • Autoreview (Codex, branch mode, P0 to P2): scoped-clean, no findings.

Not proven

  • The 2026.11.1 through 2026.11.4 shape (tree/ only, no file list) after a move: still kept, with the new message.
  • Windows and Linux hosts, and a Git install: not run. The census refuses inside containers by design, so a Linux Docker cell cannot show removal; earlier Linux pnpm cells show the same no recognized runtime marker from these drivers.
  • The base moved during the work: 541ebfbbe75 (red) to 8e2c8f5b57a (fix commit) to the merge 5ea717d987b. The commits in between touch chat, config schemas and Gateway startup custody, not retained-runtime cleanup, its callers or the census.
  • The live instance was not touched; its two folders match this shape (three entries, file list starting with the old checkout's package.json, projected openclaw package).
  • A message at plain Gateway start: a gateway restart added no Runtime retained lines on either build. The repeated lines seen in the Gateway log come from update and Doctor runs.

…stallation moves

Updaters through 2026.11.10 record no owner.json. Cleanup recognized their
runtime only by projecting the current package root into its tree, so once
a pnpm global update or a Git release folder moved the installation, the
runtime (about 0.6 to 3.7 GiB each) was reported as "no recognized runtime
marker" on every update and Doctor run and never removed.

The runtime's own retained-files.json starts with the package.json it
retained. When a directory holds exactly retained-files.json, tree/ and
update-native-gate.mjs, and the projection of that path is an OpenClaw
package.json reached without symbolic links, it is treated as the updater
runtime it is and goes through the unchanged custody checks. Directories that
match neither shape are kept with a message that says so and asks for no
manual step.
@clawsweeper

clawsweeper Bot commented Nov 26, 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 docs Improvements or additions to documentation size: S labels Nov 26, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 26, 2026
@clawsweeper

clawsweeper Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

Recognizes updater copies left by shipped releases after the installation moves, allowing existing cleanup checks to reclaim them.

Example: A 2026.11.10 updater leaves an ownerless runtime whose recorded pnpm installation path no longer exists.

  • Before: Doctor retains it with “no recognized runtime marker.”
  • After: Doctor recognizes its projected OpenClaw package and removes it when custody checks permit.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused patch has useful regression coverage and no identified correctness finding, but required proof through the shipped commands is unfinished.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Old updater copies consume gigabytes indefinitely after an installation moves, despite repeated update and Doctor runs.
Reason: The maintainer-authored direction repairs a reported shipped-release cleanup failure without adding configuration or changing stored formats.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses a source-confirmed cleanup gap on current main, with no concrete patch defect found.

Reviewed head: 5ea717d987bd67a48ec0f7e5258f737652fbd5cb

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide redacted CLI output from a fresh installation and a v2026.11.10-to-head upgrade showing moved-path runtime reclamation, live and unrecognized directory preservation, and settings/data intact; redact IPs, keys, phone numbers, and non-public endpoints.
Agent review details

How this fits together

Update and Doctor commands send discovered runtime directories to the shared cleanup owner, which checks their identity and process custody before removing eligible copies and reporting outcomes.

flowchart TD
  A[Update command] --> C[Runtime cleanup owner]
  B[Doctor command] --> C
  C --> D[Runtime recognition]
  D --> E[Identity and custody checks]
  E --> F[Remove or retain and report]
Loading

Technical review

Best possible solution:

Keep the existing cleanup owner and validate its shipped-format recognition through actual update and Doctor commands.

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

Current-main source establishes that an ownerless runtime from a moved installation can fail recognition; the PR reports matching red tests and the linked discussion documents real leftovers, but this review ran no target code.

Is this the best way to solve the issue?

Reading the shipped runtime's own manifest path is a focused repair at the existing owner, with conservative custody checks preserved.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9239eeb2df37.

Provenance checked

  • Ownerless runtime recognition changes intended behavior with a stated reason (165fd29: Recognize projected OpenClaw packages through symlink-safe, bounded checks while preserving unknown directories; this PR explains why shipped self-description can recover moved installation paths.)
  • Manual cleanup guidance changes intended behavior with a stated reason (84cab03: The prior release-update repair documented manual removal when the original installation path was lost; this PR replaces that workaround for the supported three-entry shipped shape.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 165fd29 adds src/infra/temp-artifact-cleanup.ts:36 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 165fd29a4c1d; files: src/infra/temp-artifact-cleanup.ts)
  • Josh Lehman: Raw commit bafbb01 adds src/infra/temp-artifact-cleanup.ts:79 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bafbb01c34af; files: src/infra/temp-artifact-cleanup.ts)

PR surface

Source +53, Tests +95, Docs +1. Total +149 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 57 4 +53
Tests 2 102 7 +95
Docs 1 8 7 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 167 18 +149

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.

Review metrics

Metric Value Why it matters
Production versus test growth Production +57/−4 lines; tests +102/−7 lines Growth adds shipped-format recognition and distinct filesystem-preservation and custody cases without another cleanup owner.

Labels

Label changes:

  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete the planned macOS CLI and latest-stable upgrade evidence for the changed recognition path.

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.

Reviewed November 26, 2026, 2:36 PM ET / 19:36 UTC.

@fuller-stack-dev
fuller-stack-dev merged commit cacd355 into openclaw:main Nov 26, 2026
146 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the fix/shipped-updater-runtime-reclaim branch November 26, 2026 20:10
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 27, 2026
…stallation moves (openclaw#206124)

Updaters through 2026.11.10 record no owner.json. Cleanup recognized their
runtime only by projecting the current package root into its tree, so once
a pnpm global update or a Git release folder moved the installation, the
runtime (about 0.6 to 3.7 GiB each) was reported as "no recognized runtime
marker" on every update and Doctor run and never removed.

The runtime's own retained-files.json starts with the package.json it
retained. When a directory holds exactly retained-files.json, tree/ and
update-native-gate.mjs, and the projection of that path is an OpenClaw
package.json reached without symbolic links, it is treated as the updater
runtime it is and goes through the unchanged custody checks. Directories that
match neither shape are kept with a message that says so and asks for no
manual step.
tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
…stallation moves (#206124)

Updaters through 2026.11.10 record no owner.json. Cleanup recognized their
runtime only by projecting the current package root into its tree, so once
a pnpm global update or a Git release folder moved the installation, the
runtime (about 0.6 to 3.7 GiB each) was reported as "no recognized runtime
marker" on every update and Doctor run and never removed.

The runtime's own retained-files.json starts with the package.json it
retained. When a directory holds exactly retained-files.json, tree/ and
update-native-gate.mjs, and the projection of that path is an OpenClaw
package.json reached without symbolic links, it is treated as the updater
runtime it is and goes through the unchanged custody checks. Directories that
match neither shape are kept with a message that says so and asks for no
manual step.

(cherry picked from commit cacd355)
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…stallation moves (#206124)

Updaters through 2026.11.10 record no owner.json. Cleanup recognized their
runtime only by projecting the current package root into its tree, so once
a pnpm global update or a Git release folder moved the installation, the
runtime (about 0.6 to 3.7 GiB each) was reported as "no recognized runtime
marker" on every update and Doctor run and never removed.

The runtime's own retained-files.json starts with the package.json it
retained. When a directory holds exactly retained-files.json, tree/ and
update-native-gate.mjs, and the projection of that path is an OpenClaw
package.json reached without symbolic links, it is treated as the updater
runtime it is and goes through the unchanged custody checks. Directories that
match neither shape are kept with a message that says so and asks for no
manual step.

(cherry picked from commit cacd355)

Release adaptation: keep the stable documentation for the legacy updater and add only moved-runtime recognition. Keep the consolidated Doctor tests instead of restoring the deleted infra test file.

Follow-up audit: 8933edd, dfd17d0 and 5c81526 address updater schema guidance, Docker startup and Doctor planning, respectively; none changes the projection recognizer or custody checks.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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.

1 participant