Skip to content

fix: shorten doctor --fix Gateway downtime by removing old updater folders before the stop - #206185

Merged
fuller-stack-dev merged 2 commits into
openclaw:mainfrom
fuller-stack-dev:fix/doctor-retained-runtimes-before-stop
Nov 26, 2026
Merged

fuller-stack-dev merged 2 commits into
openclaw:mainfrom
fuller-stack-dev:fix/doctor-retained-runtimes-before-stop

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

Related: #204775

What Problem This Solves

Every openclaw doctor --fix stops a running Gateway, and the stop covered steps that never needed it. One of them is the cleanup of abandoned updater folders (openclaw-update-runtime-*, about 600 MB each). Removing one took 0.8 to 1.1 s inside the stop in our test cell. This is step 2 of the plan in the #204775 design comment: run the steps that do not need the stop while the Gateway serves.

User Impact

doctor --fix removes abandoned updater folders before it stops the Gateway, so the Gateway is down for that much less time. The folders it removes, the ones it keeps and its messages are unchanged. A cleanup failure is reported and no longer blocks the repairs that need the stop. Every --fix still stops the Gateway.

Why This Change Was Made

I checked each step named in the plan against what the stopped window protects (state and agent databases, config the Gateway holds or rewrites, files it writes concurrently):

Step Decision Reason from source
Updater runtime cleanup Moved before the stop Reads and writes no database. Each runtime's owner.json and the process census decide custody. The release updater (reclaimRetainedUpdateRuntimes in src/update/cli.ts) already runs the same pass beside a serving Gateway.
Client credentials Stays On SQLite installs it returns at once. On PostgreSQL it migrates the state schema and recreates client identities under an exclusive lock on the local credential store, which the Gateway uses.
External config check Stays Read-only (0.1 ms), but it decides whether the Gateway may start; moving it after the restart would replace its message with a failed restart.
Maintenance readiness Stays Verifies the repaired databases before the Gateway starts, and records migration-backup completion, which needs maintenance custody. Its result also gates SQLite reclamation.
Workspace and shell completion Stays in this PR They are contributions inside the shared contribution run. Moving them needs a placement field on the contribution contract; in the cell they took about 5 ms (plus about 0.3 s of read-only workspace diagnostics).

Why before the stop and not after the restart: a first version ran the cleanup right after the restart. In two of three runs the census found a process it could not classify (a child the new Gateway starts during startup, such as its SQLite integrity worker) and conservatively kept the folder. The serving Gateway before the stop is in steady state, like the release updater's case.

What the Gateway can do meanwhile: it never runs code from an updater runtime; the census classifies it as a non-updater and treats any process that references the folder as a holder. An update it starts creates a new folder with an owner record naming a live PID, so that folder is kept. Doctor still retires its own idle readers and spawn broker first and keeps any folder one of its own workers loaded code from. A signal lets an in-progress removal finish.

Not changed: the readiness steps that stay in the stop moved unchanged into doctor-health-maintenance-steps.ts so doctor-health.ts stays under its line cap. The cleanup no longer checks the update requester's write authority, which only governs Doctor's state writes; the release updater runs this pass without it too.

Update behavior

No update-path change. A published updater that runs Doctor on this build gets the cleanup before Doctor's maintenance begins. The updater's own runtime has an owner record with its live PID, so it is kept, as before.

Evidence

Linux cell, systemd user Gateway, npm install, 4 GiB agent database with 1 MiB/s of writes, /readyz probed every 250 ms. Base pack is main at d0f76989509, head pack is fe42d651b7d (this PR), both under unpublished version numbers. Each cell runs openclaw doctor --fix --non-interactive --yes three times. Before each run the harness plants an abandoned updater folder (owner record of an exited PID, hard-linked copy of the installed package: 47,883 entries, 596 MB) and a look-alike folder without an updater's marks (negative control). Run 3 also plants a second folder whose inner directory is read-only, so its removal fails.

Fixture note: the census refuses inside any container it detects, by design. These cells run with a private cgroup namespace and without /.dockerenv, so the real census runs. No other container shares the cell's volume. A first base cell without that change kept every folder with "Host process visibility cannot be established from this container".

Run Cleanup position (s after "Stopped the managed Gateway") base / head Cleanup time base / head Outage base / head
1 +35.2 (inside) / -14.6 (before) 0.87 s / 0.54 s 47.9 s / 45.4 s
2 +34.3 (inside) / -16.1 (before) 1.11 s / 0.67 s 47.4 s / 42.8 s
3, failing folder +31.2 (inside) / -17.1 (before) 0.78 s / 0.86 s 43.2 s / 43.9 s
  • Effects are the same in both cells: the planted folder is removed every run, the look-alike folder is kept, the installed package keeps all its files, and in run 3 the read-only folder is kept with cleanup failed: EACCES reported. Every run exits 0 with a new Gateway PID, NRestarts=0, and the Gateway ready.
  • About 0.8 to 1.1 s left the stop per run with work. The host load was high (5 to 11) during both cells, and outage differences between runs are larger than that, so the outage numbers here are within noise. I don't claim an outage win from these cells beyond the cleanup time that moved out.

RED/BASE, d0f76989509 (cleanup inside the stop):

red-base-d0f76989509.mp4

GREEN/HEAD, fe42d651b7d (cleanup before the stop):

green-head-fe42d651b7d.mp4
Raw lines, base d0f7698 (home path shortened)
---- base-4096 doctor1: openclaw doctor --fix --non-interactive --yes (doctor1 ok)
planted ~/um/tmp/openclaw-update-runtime-Step2a: 47882 entries, 595694055 bytes, owner pid 2145 (exited)
install-files-before: 44793
runtimes-before: ~/um/tmp/openclaw-update-runtime-Keep02 ~/um/tmp/openclaw-update-runtime-Step2a 
before: MainPID=1477 NRestarts=0 ActiveState=active SubState=running 
doctor-end-ms=1795727681780 doctor-exit=0 doctor-ms=75277
after: MainPID=7926 NRestarts=0 ActiveState=active SubState=running 
runtimes-after: ~/um/tmp/openclaw-update-runtime-Keep02 
install-files-after: 44793
negative-control kept: ~/um/tmp/openclaw-update-runtime-Keep02
  t=   +0.0s  Stopped the managed Gateway for Doctor repair.
  t=  +35.2s  [gateway] startup trace: doctor.pending.retained-runtimes 0.0ms
  t=  +35.3s  [infra:temp-artifacts] Runtime retained at ~/um/tmp/openclaw-update-runtime-Keep02: it does not match a runtime an OpenClaw updater created, so it is kept
  t=  +35.9s  │ Removed abandoned updater runtime: │
  t=  +36.1s  [gateway] startup trace: doctor.retained-runtimes 868.4ms
  t=  +39.3s  Restarted systemd service: openclaw-gateway.service
  t=  +47.3s  Gateway restarted and verified after Doctor maintenance.
  t=  +47.3s  The Gateway was stopped for 47.6 s.
  t=  +47.3s  [gateway] startup trace: doctor.maintenance.finish 11237.7ms
  OUTAGE (/readyz): 47.9s
  stopped->started: 40.0s; stop request->stopped: 0.3s; started->ready: 7.8s
---- base-4096 doctor2: openclaw doctor --fix --non-interactive --yes (doctor2 ok)
planted ~/um/tmp/openclaw-update-runtime-Step2a: 47882 entries, 595694055 bytes, owner pid 9007 (exited)
install-files-before: 44793
runtimes-before: ~/um/tmp/openclaw-update-runtime-Keep02 ~/um/tmp/openclaw-update-runtime-Step2a 
before: MainPID=7926 NRestarts=0 ActiveState=active SubState=running 
doctor-end-ms=1795727767169 doctor-exit=0 doctor-ms=65436
after: MainPID=14256 NRestarts=0 ActiveState=active SubState=running 
runtimes-after: ~/um/tmp/openclaw-update-runtime-Keep02 
install-files-after: 44793
negative-control kept: ~/um/tmp/openclaw-update-runtime-Keep02
  t=   +0.0s  Stopped the managed Gateway for Doctor repair.
  t=  +34.3s  [gateway] startup trace: doctor.pending.retained-runtimes 0.0ms
  t=  +34.3s  [infra:temp-artifacts] Runtime retained at ~/um/tmp/openclaw-update-runtime-Keep02: it does not match a runtime an OpenClaw updater created, so it is kept
  t=  +35.2s  │ Removed abandoned updater runtime: │
  t=  +35.4s  [gateway] startup trace: doctor.retained-runtimes 1110.0ms
  t=  +38.9s  Restarted systemd service: openclaw-gateway.service
  t=  +46.8s  Gateway restarted and verified after Doctor maintenance.
  t=  +46.8s  The Gateway was stopped for 47.1 s.
  t=  +46.8s  [gateway] startup trace: doctor.maintenance.finish 11464.0ms
  OUTAGE (/readyz): 47.4s
  stopped->started: 39.5s; stop request->stopped: 0.3s; started->ready: 7.7s
---- base-4096 doctor3: openclaw doctor --fix --non-interactive --yes (doctor3 fail)
planted ~/um/tmp/openclaw-update-runtime-Step2a: 47882 entries, 595694056 bytes, owner pid 15331 (exited)
planted ~/um/tmp/openclaw-update-runtime-Step2f: 47884 entries, 595694061 bytes, owner pid 15343 (exited)
install-files-before: 44793
runtimes-before: ~/um/tmp/openclaw-update-runtime-Keep02 ~/um/tmp/openclaw-update-runtime-Step2a ~/um/tmp/openclaw-update-runtime-Step2f 
before: MainPID=14256 NRestarts=0 ActiveState=active SubState=running 
doctor-end-ms=1795727849179 doctor-exit=0 doctor-ms=61614
after: MainPID=20455 NRestarts=0 ActiveState=active SubState=running 
runtimes-after: ~/um/tmp/openclaw-update-runtime-Keep02 ~/um/tmp/openclaw-update-runtime-Step2f 
install-files-after: 44793
negative-control kept: ~/um/tmp/openclaw-update-runtime-Keep02
  t=   +0.0s  Stopped the managed Gateway for Doctor repair.
  t=  +31.2s  [gateway] startup trace: doctor.pending.retained-runtimes 0.0ms
  t=  +31.2s  [infra:temp-artifacts] Runtime retained at ~/um/tmp/openclaw-update-runtime-Keep02: it does not match a runtime an OpenClaw updater created, so it is kept
  t=  +31.8s  [infra:temp-artifacts] Runtime retained at ~/um/tmp/openclaw-update-runtime-Step2f: cleanup failed: EACCES: permission denied, unlink '~/um/tmp/openclaw-update-runti
  t=  +31.8s  │ Removed abandoned updater runtime: │
  t=  +31.9s  [gateway] startup trace: doctor.retained-runtimes 783.4ms
  t=  +35.3s  Restarted systemd service: openclaw-gateway.service
  t=  +42.4s  Gateway restarted and verified after Doctor maintenance.
  t=  +42.4s  The Gateway was stopped for 42.6 s.
  t=  +42.4s  [gateway] startup trace: doctor.maintenance.finish 10410.0ms
  OUTAGE (/readyz): 43.2s
  stopped->started: 36.0s; stop request->stopped: 0.3s; started->ready: 7.0s
Raw lines, head fe42d65 (home path shortened)
---- head-4096 doctor1: openclaw doctor --fix --non-interactive --yes (doctor1 ok)
planted ~/um/tmp/openclaw-update-runtime-Step2a: 47883 entries, 595679819 bytes, owner pid 2143 (exited)
install-files-before: 44794
runtimes-before: ~/um/tmp/openclaw-update-runtime-Keep02 ~/um/tmp/openclaw-update-runtime-Step2a 
before: MainPID=1477 NRestarts=0 ActiveState=active SubState=running 
doctor-end-ms=1795728986256 doctor-exit=0 doctor-ms=63361
after: MainPID=7540 NRestarts=0 ActiveState=active SubState=running 
runtimes-after: ~/um/tmp/openclaw-update-runtime-Keep02 
install-files-after: 44794
negative-control kept: ~/um/tmp/openclaw-update-runtime-Keep02
  t=  -14.6s  [gateway] startup trace: doctor.pending.retained-runtimes 0.0ms
  t=  -14.5s  [infra:temp-artifacts] Runtime retained at ~/um/tmp/openclaw-update-runtime-Keep02: it does not match a runtime an OpenClaw updater created, so it is kept
  t=  -14.1s  │ Removed abandoned updater runtime: │
  t=  -14.1s  [gateway] startup trace: doctor.retained-runtimes 541.3ms
  t=   +0.0s  Stopped the managed Gateway for Doctor repair.
  t=  +37.8s  Restarted systemd service: openclaw-gateway.service
  t=  +45.0s  Gateway restarted and verified after Doctor maintenance.
  t=  +45.0s  The Gateway was stopped for 45.3 s.
  t=  +45.0s  [gateway] startup trace: doctor.maintenance.finish 10179.5ms
  OUTAGE (/readyz): 45.4s
  stopped->started: 38.5s; stop request->stopped: 0.3s; started->ready: 6.8s
---- head-4096 doctor2: openclaw doctor --fix --non-interactive --yes (doctor2 ok)
planted ~/um/tmp/openclaw-update-runtime-Step2a: 47883 entries, 595679819 bytes, owner pid 8578 (exited)
install-files-before: 44794
runtimes-before: ~/um/tmp/openclaw-update-runtime-Keep02 ~/um/tmp/openclaw-update-runtime-Step2a 
before: MainPID=7540 NRestarts=0 ActiveState=active SubState=running 
doctor-end-ms=1795729069290 doctor-exit=0 doctor-ms=63645
after: MainPID=13842 NRestarts=0 ActiveState=active SubState=running 
runtimes-after: ~/um/tmp/openclaw-update-runtime-Keep02 
install-files-after: 44794
negative-control kept: ~/um/tmp/openclaw-update-runtime-Keep02
  t=  -16.1s  [gateway] startup trace: doctor.pending.retained-runtimes 0.0ms
  t=  -16.0s  [infra:temp-artifacts] Runtime retained at ~/um/tmp/openclaw-update-runtime-Keep02: it does not match a runtime an OpenClaw updater created, so it is kept
  t=  -15.4s  │ Removed abandoned updater runtime: │
  t=  -15.4s  [gateway] startup trace: doctor.retained-runtimes 665.8ms
  t=   +0.0s  Stopped the managed Gateway for Doctor repair.
  t=  +35.0s  Restarted systemd service: openclaw-gateway.service
  t=  +42.3s  Gateway restarted and verified after Doctor maintenance.
  t=  +42.3s  The Gateway was stopped for 42.6 s.
  t=  +42.3s  [gateway] startup trace: doctor.maintenance.finish 10691.0ms
  OUTAGE (/readyz): 42.8s
  stopped->started: 35.8s; stop request->stopped: 0.3s; started->ready: 6.9s
---- head-4096 doctor3: openclaw doctor --fix --non-interactive --yes (doctor3 fail)
planted ~/um/tmp/openclaw-update-runtime-Step2a: 47883 entries, 595679820 bytes, owner pid 14890 (exited)
planted ~/um/tmp/openclaw-update-runtime-Step2f: 47885 entries, 595679825 bytes, owner pid 14902 (exited)
install-files-before: 44794
runtimes-before: ~/um/tmp/openclaw-update-runtime-Keep02 ~/um/tmp/openclaw-update-runtime-Step2a ~/um/tmp/openclaw-update-runtime-Step2f 
before: MainPID=13842 NRestarts=0 ActiveState=active SubState=running 
doctor-end-ms=1795729154185 doctor-exit=0 doctor-ms=64695
after: MainPID=20165 NRestarts=0 ActiveState=active SubState=running 
runtimes-after: ~/um/tmp/openclaw-update-runtime-Keep02 ~/um/tmp/openclaw-update-runtime-Step2f 
install-files-after: 44794
negative-control kept: ~/um/tmp/openclaw-update-runtime-Keep02
  t=  -17.1s  [gateway] startup trace: doctor.pending.retained-runtimes 0.0ms
  t=  -17.0s  [infra:temp-artifacts] Runtime retained at ~/um/tmp/openclaw-update-runtime-Keep02: it does not match a runtime an OpenClaw updater created, so it is kept
  t=  -16.2s  [infra:temp-artifacts] Runtime retained at ~/um/tmp/openclaw-update-runtime-Step2f: cleanup failed: EACCES: permission denied, unlink '~/um/tmp/openclaw-update-runti
  t=  -16.2s  │ Removed abandoned updater runtime: │
  t=  -16.2s  [gateway] startup trace: doctor.retained-runtimes 861.6ms
  t=   +0.0s  Stopped the managed Gateway for Doctor repair.
  t=  +35.6s  Restarted systemd service: openclaw-gateway.service
  t=  +43.5s  Gateway restarted and verified after Doctor maintenance.
  t=  +43.5s  The Gateway was stopped for 43.7 s.
  t=  +43.5s  [gateway] startup trace: doctor.maintenance.finish 11877.2ms
  OUTAGE (/readyz): 43.9s
  stopped->started: 36.2s; stop request->stopped: 0.3s; started->ready: 7.5s

Tests

  • src/flows/doctor-retained-runtime.settlement.test.ts: the complete Doctor flow now asserts the cleanup runs before Doctor takes state custody (no maintenance scope, state owner free, checks not started), that the folder is already gone when the checks run, and that a broker settlement failure is reported while the stopped repairs still run. Red on base: 7 of 7 fail (base runs the cleanup after the checks, under custody). The checks-scope reader case (PID 42421) was removed: that scope does not exist before the stop. The idle read pool and plugin preparation cases now create their workers before the flow, as Doctor's own earlier reads do.
  • src/flows/doctor-health.migration-refusal.test.ts: the ordering case now expects cleanup, then checks, SQLite repairs and restoration. New case: a cleanup failure is reported and maintenance, checks and restoration still run. The cleanup is mocked for this file because the real one scans the host temp directory.
  • src/commands/doctor-maintenance.requester-authority.test.ts: the post-repair drain-and-reenter step now uses SQLite reclamation, the post-repair step that stays in custody, instead of the removed in-custody cleanup.
  • Focused suites on fe42d651b7d: src/commands/doctor-maintenance*.test.ts, src/flows/doctor-health*.test.ts, src/flows/doctor-retained-runtime*.test.ts, src/cli/update-cli/update-command-lifecycle.test.ts, src/update/cli.test.ts, src/infra/temp-artifact-cleanup.test.ts: all green (5 Vitest shards: 635 passed, 13 skipped; the skips are existing platform skips). Also green: pnpm tsgo:core, pnpm tsgo:core:test, the line-cap ratchet, the session identity ratchet, git diff --check.
  • Files audited in full: the three test files above and doctor-maintenance.test-support.ts (its cleanupRetainedRuntimes stub went with the method).
  • Review: $autoreview (Codex, branch mode against origin/main, P0 to P2) returned scoped-clean.

Not proven

  • macOS and Windows Doctor runs, pnpm and Git installs.
  • The census race seen after a restart could also hit a busy steady-state Gateway that spawns children often. The folder is then kept and reported, as before, and the next --fix or update retries.
  • The cells ran on fe42d651b7d. The branch then merged main (unrelated changes, including plugin preparation worker release in fix(plugins): release idle workers after preparing bundled state operations #206172). The settlement, retained-runtime, migration-refusal and requester-authority suites were rerun on the merged head 877ca888d77 (59 passed); the cells were not.
  • Config publication and service definition repair were not moved; they need agreement from their owners on Design: prepared-release updates (state, ownership and plan) #204775.

…teway

Retained updater runtime cleanup ran inside the doctor --fix Gateway stop.
It reads no database, and each runtime's owner record and the process
census decide custody, as in the release updater, which already runs it
beside a serving Gateway. It now runs before the stop; a failure is
reported and no longer blocks the repairs that need the stop. The
startup readiness steps that stay inside the stop move unchanged into
the maintenance steps module.
@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 commands Command implementations size: M 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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 26, 2026
@clawsweeper

clawsweeper Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: passed.

What this changes

This PR moves abandoned updater-runtime cleanup before Doctor stops the Gateway and makes cleanup failures advisory.

Example: Run openclaw doctor --fix with an abandoned 596 MB updater folder.

  • Before: Folder removal runs while the Gateway is stopped.
  • After: Folder removal finishes before the stop; a removal failure is reported while subsequent repairs continue.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is focused and supported by production logs, but required stable-upgrade validation remains incomplete.
Proof confidence 🦪 silver shellfish (2/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: Performance · Worth it: Yes · Fix scope: Partial
User problem: Doctor keeps the Gateway unavailable while deleting abandoned updater folders that need no database maintenance custody.
Reason: The maintainer-authored change implements a bounded part of the recorded downtime plan and preserves conservative holder checks; other planned steps appropriately remain separate.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a useful, focused improvement, and no definite introduced defect was found.

Reviewed head: 877ca888d7754344d1876647c52c6e86523a460c

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide a latest-stable v2026.11.10-to-candidate upgrade run followed by Doctor cleanup, showing existing settings/data intact, eligible retained folders removed before the stop, and successful Gateway restoration; redact sensitive values.
Agent review details

How this fits together

Doctor coordinates Gateway maintenance; the shared retained-runtime owner inspects temporary folders, checks process custody, and removes eligible abandoned artifacts.

flowchart TD
  A[Doctor repair request] --> B[Retained runtime cleanup]
  B --> C[Owner records and process census]
  C --> D[Remove or preserve runtime]
  D --> E[Gateway maintenance and repairs]
  E --> F[Readiness checks and restoration]
Loading

Technical review

Best possible solution:

Keep runtime deletion with its existing owner before maintenance while preserving custody checks and advisory failure reporting.

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

Current-main ordering establishes that cleanup runs inside maintenance, and supplied base CLI logs show its removal work between stop and restoration; no target code was executed during this review.

Is this the best way to solve the issue?

Moving the existing filesystem cleanup before the stop addresses unnecessary stopped-window work without introducing a second deletion policy; the readiness extraction preserves its prior ordering.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 47b2cdd86ee6.

Provenance checked

  • Worker settlement before runtime deletion keeps the original intent (4f57582: Doctor's inspection workers prevented reclamation; their existing owners had to settle before the conservative process census ran.)
  • Runtime-specific native-worker protection keeps the original intent (9c0b599: Unrelated plugin workers must not block every cleanup, while workers executing inside a candidate runtime must preserve it.)
  • Maintenance custody and cleanup failure behavior changes intended behavior with a stated reason (4f57582: Cleanup previously ran after database inspections under retained maintenance authority and refused restoration on settlement failure; this PR explains why pre-stop filesystem cleanup needs neither database custody nor a restoration refusal.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned change and current main: The introduced diff moves cleanup before beginDoctorMaintenance and removes its former post-check maintenance method; fetched main still runs cleanup inside maintenance. (src/flows/doctor-health.ts:229, 877ca888d775)
  • Custody remains with the existing cleanup owner: The change retains worker-path checks and delegates recognition, live-owner checks, process census, and deletion to maintainRetainedUpdateRuntimes; the release CLI already uses that owner beside a serving Gateway. (src/commands/doctor-retained-runtime.ts:76, 877ca888d775)
  • Recorded product direction: The maintainer-authored plan in Design: prepared-release updates (state, ownership and plan) #204775 explicitly places retained-runtime cleanup outside the stopped window; this PR implements that portion without making the stop conditional.
  • Production behavior evidence: The full PR body records Linux npm/systemd CLI runs with a serving Gateway and database writes: cleanup precedes the stop, look-alikes survive, EACCES is reported, and restoration succeeds. Total-outage improvement is explicitly unclaimed because of noise. No stable-to-candidate upgrade run is supplied.
  • Proof reuse and media limitation: Production files governing the demonstrated behavior are unchanged between the recorded fe42d65 run and the reviewed head. Both downloaded videos lack prepared stills because the manifest reports 'ffprobe failed: spawnSync ffprobe ENOENT'; no browser playback tool is available, so assessment uses the independently readable raw logs. (src/commands/doctor-retained-runtime.ts:52, 877ca888d775)
  • Required checks remain pending: The reviewed head has an in-progress Node check and pending ci-gate; dependency and security-sensitive review statuses succeed, with no failed check established. (877ca888d775)

Likely related people:

  • Jason (Json): Raw commit 84cab03 adds src/commands/doctor-retained-runtime.ts:15 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 84cab039664a; files: src/commands/doctor-retained-runtime.ts)

PR surface

Source +46, Tests +6. Total +52 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 146 100 +46
Tests 4 83 77 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 229 177 +52

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.

Root-cause cluster

Relationship: partial_overlap
Canonical: #204775
Summary: This PR implements the retained-runtime portion of the broader Doctor downtime plan.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish 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: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish 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.

  • Supply the stable-to-candidate upgrade evidence described in the proof assessment.

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, 5:02 PM ET / 22:02 UTC.

@fuller-stack-dev
fuller-stack-dev merged commit 3495c16 into openclaw:main Nov 26, 2026
126 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the fix/doctor-retained-runtimes-before-stop branch November 26, 2026 22:08
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 27, 2026
…teway (openclaw#206185)

Retained updater runtime cleanup ran inside the doctor --fix Gateway stop.
It reads no database, and each runtime's owner record and the process
census decide custody, as in the release updater, which already runs it
beside a serving Gateway. It now runs before the stop; a failure is
reported and no longer blocks the repairs that need the stop. The
startup readiness steps that stay inside the stop move unchanged into
the maintenance steps module.
tideclaw-bot pushed a commit that referenced this pull request Nov 28, 2026
…teway (#206185)

Retained updater runtime cleanup ran inside the doctor --fix Gateway stop.
It reads no database, and each runtime's owner record and the process
census decide custody, as in the release updater, which already runs it
beside a serving Gateway. It now runs before the stop; a failure is
reported and no longer blocks the repairs that need the stop. The
startup readiness steps that stay inside the stop move unchanged into
the maintenance steps module.

(cherry picked from commit 3495c16)

Backport adaptation: Call the guarded retained-runtime cleanup before the existing inline Doctor maintenance start, preserve existing readiness sequencing, and omit the separate post-check flow extraction.

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…teway (#206185)

Retained updater runtime cleanup ran inside the doctor --fix Gateway stop.
It reads no database, and each runtime's owner record and the process
census decide custody, as in the release updater, which already runs it
beside a serving Gateway. It now runs before the stop; a failure is
reported and no longer blocks the repairs that need the stop. The
startup readiness steps that stay inside the stop move unchanged into
the maintenance steps module.

(cherry picked from commit 3495c16)

Release adaptation: move only standalone Doctor cleanup to the stable flow before beginDoctorMaintenance; keep startup readiness inline and retain updater-owned cleanup for managed update children. Do not import the already-removed maintenance-steps split or change the existing authority grant.

Follow-up audit: 43b5b52, 19e9dd6, 218d29f, e2e0974, 52eccde, 18e53d8, 91d4912, fd681ab, c32abfe, 5c81526 and 33ba1b1 cover separate shutdown/readiness, update recovery, work planning, and export concerns; the stable cleanup owner needs none of them.

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

commands Command implementations impact:other This issue has meaningful maintainer-visible impact outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M 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