Repository navigation
fix(update): updates keep a full pre-update copy until the next update - #196872
fuller-stack-dev merged 2 commits into
Conversation
A successful update kept a full copy of the pre-update state, plus the Doctor migration originals it produced, until the next update succeeded. Once the update's Gateway health verification is recorded, nothing it captured is still needed for recovery, so automatic cleanup retires them.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesVerified healthy updates immediately retire their own recovery captures and eligible Doctor migration originals. Example: The published 2026.11.3 updater completes an update and confirms Gateway readiness.
Review scores
ProductKind: Preference · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: it makes a focused retention change absent from current main, and review found no actionable introduced defect. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherUpdate completion records and Doctor manifests feed the shared recovery inventory; the existing state owner verifies eligible artifacts and deletes recovery originals while preserving live state. flowchart TD
A[Update completion] --> B[Recorded Gateway verification]
B --> C[Shared recovery inventory]
D[Doctor migration manifests] --> C
C --> E[State owner and retirement checks]
E --> F[Eligible recovery copies removed]
Technical reviewBest possible solution: Use the existing cleanup owners to release verified updates' recovery copies while retaining unverified and unresolved recovery sources. Do we have a high-confidence way to reproduce the issue? Current-main classifiers demonstrably retain the latest update's copies, and the body reports a matching stable-updater reproduction; this review executed no target code. Is this the best way to solve the issue? The patch is a small, complete retention-policy change using existing inventory and retirement owners, with distinct verified and unverified regression coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6f18dd48112d. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +20, Tests +35, Docs +16, Other +2. Total +73 across 10 files. Added test files: 0. 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 10, 2026, 4:43 PM ET / 21:43 UTC. |
|
Merged via squash.
|
openclaw#196872) * fix(update): retire a verified update's own recovery copies A successful update kept a full copy of the pre-update state, plus the Doctor migration originals it produced, until the next update succeeded. Once the update's Gateway health verification is recorded, nothing it captured is still needed for recovery, so automatic cleanup retires them. * test: allocate verified update capture retirement lines
* fix(test): keep unverified recovery captures in disk usage fixtures Preserve protected and retirable reporting coverage after verified updates began retiring their own capture in #196872. No retention policy or assertion changes. Co-authored-by: steipete <[email protected]> Co-authored-by: obviyus <[email protected]> * fix(test): preserve protected recovery-copy reporting coverage Worked on by: - @obviyus - @steipete Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 6303da83-3c06-83ad-a7cd-e5f1f5817e37 --------- Co-authored-by: steipete <[email protected]> Co-authored-by: obviyus <[email protected]>
…law#197138) * fix(test): keep unverified recovery captures in disk usage fixtures Preserve protected and retirable reporting coverage after verified updates began retiring their own capture in openclaw#196872. No retention policy or assertion changes. Co-authored-by: steipete <[email protected]> Co-authored-by: obviyus <[email protected]> * fix(test): preserve protected recovery-copy reporting coverage Worked on by: - @obviyus - @steipete Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]> OpenClaw-Publication: 6303da83-3c06-83ad-a7cd-e5f1f5817e37 --------- Co-authored-by: steipete <[email protected]> Co-authored-by: obviyus <[email protected]>
What Problem This Solves
Fixes: every successful update leaves a full copy of the pre-update state, and the Doctor
.bakbackups its migrations made, on disk until the next update succeeds. Large installs run out of space on their next update.User Impact
User impact: once an update's Gateway passes its health verification, that update deletes its own pre-update copy and the Doctor migration backups it produced. Updates that aren't verified healthy keep their copies as before, including failed, rolled-back, unfinished,
--no-restart, and already-current runs.To keep a downgrade path, create a backup with
openclaw backup createbefore updating. That is already the documented downgrade path: these copies are recovery sources for a failed update, not a full pre-update backup.Why This Change Was Made
Cleanup kept the latest update's copy until a later update started. A copy is only needed until the update proves it works. A successful update whose Gateway verification is confirmed (service running, version match, readiness, settled channels, no plugin errors) now supersedes:
verified-update-capture);The automatic cleanup that runs after each update applies this. Its guard against clock skew still keeps an unverified run's own copy. Older shipped updaters reach the same code through the Gateway's
update.recovery.cleanupRPC.Evidence
OPENCLAW_PUBLISHED_DRIVER_LEGACY_SQLITE=1 scripts/e2e/published-driver-update-docker.sh, with the shipped 2026.11.3 updater driving each run:1651ee19:PASS … readyz=200; post-update cleanupremoved 4 files (632 logical bytes), and the update's own copy is kept.PASS … readyz=200; post-update cleanupremoved 8 files (31043914 logical bytes), so the update's ~31 MB copy is gone.src/commands/update-automatic-cleanup.test.ts: a verified update removes its own copy and a.bakits activation produced. It fails on main ([true, true]) and passes here. An unverified control keeps both, on main and here.src/cli/update-cli/update-command-capture-cleanup.test.ts:verified-update-capture.unverifiedsuccess keeps theawaiting-later-verified-updateprotection that case used to prove.superseded-update-capturereason.node scripts/check-changed.mjspasses, with the dead-export scan skipped because it already fails on main for untouched files. The test-lines ratchet passes with a 35-line allocation.