Repository navigation
fix(update): failed updates that never activated keep their capture forever - #185223
fuller-stack-dev merged 2 commits into
Conversation
…orever A failed update that stopped before repair or activation left its original-state capture protected as unresolved-failed-update, although the installation and state never changed. isNeverActivatedFailedUpdate proves this from required ledger phase receipts. Cleanup classifies such captures as never-activated-update-capture candidates, the failed run's terminal runs the existing automatic recovery cleanup (releasing only its own capture guard), and update status reports leftover sets as stale. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🦞👀 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 changesRetire captures from failed updates whose recorded history establishes that repair and activation never began. Example: A git update fails during validating at updater-runtime-retention, leaving a 22 GB capture.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a current capture-retention bug with a focused shared predicate. The prior restart-harness finding is fixed, and no new actionable defect was found; current-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe updater records lifecycle receipts in its ledger; cleanup and status consume those receipts to classify captures, while the existing state owner controls deletion. flowchart TD
A[Update execution] --> B[Ledger receipts]
B --> C[Never activated predicate]
C --> D[Terminal cleanup]
C --> E[Manual cleanup inventory]
C --> F[Recovery status]
D --> G[State owner retirement]
E --> G
Technical reviewBest possible solution: Use one conservative ledger predicate across automatic cleanup, manual classification, and status while preserving existing retirement custody. Do we have a high-confidence way to reproduce the issue? Current-main classification directly protects a sealed failed capture even when its receipts stop at validation; the PR reports matching released runs and red-on-base integration cases, but this review executed no target code. Is this the best way to solve the issue? The change is focused: it shares one decision across the affected consumers, reuses existing cleanup machinery, and retains captures when mutation or incomplete history prevents a safe conclusion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c04b1fbce64b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +69, Tests +118, Docs +9. Total +196 across 14 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 HistoryReview history (1 earlier review cycle)
Reviewed October 26, 2026, 8:32 PM ET / October 27, 2026, 00:32 UTC (Revision 2). |
The terminal now asks whether a failed run never activated before running its own recovery cleanup. Every case in this harness fails after the swap. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Both items are addressed.
The remaining CI failure, @clawsweeper re-review 🤖 Addressed by Claude Code |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…orever (openclaw#185223) * fix(update): failed updates that never activated keep their capture forever A failed update that stopped before repair or activation left its original-state capture protected as unresolved-failed-update, although the installation and state never changed. isNeverActivatedFailedUpdate proves this from required ledger phase receipts. Cleanup classifies such captures as never-activated-update-capture candidates, the failed run's terminal runs the existing automatic recovery cleanup (releasing only its own capture guard), and update status reports leftover sets as stale. * test(update): stub never-activated check in the restart outcome harness The terminal now asks whether a failed run never activated before running its own recovery cleanup. Every case in this harness fails after the swap.
Related: #185178
What Problem This Solves
Fixes: a failed
openclaw updatethat stopped before activation keeps its original-state capture forever.update cleanupreports it asprotected/unresolved-failed-update, although the installation and state never changed. On one large installation, two such failures left 22 GB captures each while the Gateway kept serving the previous version.User Impact
User impact: when an update fails before repair or activation, it now retires its own capture as soon as the failure is recorded. Captures left by earlier failures of this kind become
candidate/never-activated-update-capture, soopenclaw update cleanupremoves them without waiting for a later successful update.openclaw update statusreports these sets as stale and points to cleanup instead of manual recovery. Failures that reached repair or activation keep their capture as the manual recovery source, as before.Why This Change Was Made
The capture only matters when the update could have changed something. The ledger already records each phase the update enters, and those phase receipts are required history. One predicate decides that a failed run never activated. The run must have its admission receipt and its own
original-state-capturereceipt, no repairing/activating/restarting/verifying phase, no repair attempt, no data-at-risk or rollback outcome, and no Doctor config writes. Only the update command takes that capture, and in that flowactivatingis recorded before the service stop or any install or state mutation. Runs that never took a capture (finalize, repair, Gateway-driven children) never qualify, and a capture receipt lost to history compaction keeps the capture protected. Cleanup classification, the failed run's terminal step, andupdate statusall use that predicate.The failed run reuses the existing automatic recovery cleanup, with the same state-owner custody, Gateway routing, and revalidation that successful updates already use. The only relaxation is the guard that keeps the triggering run's own capture, and it applies only to such a run. Other artifacts keep their existing eligibility rules. A run without these receipts, such as older or synthetic history, is never treated as unchanged.
Evidence
origin/mainf25249704a8b: with only the new tests applied,update cleanupclassifies a failed staging/validating run's capture asprotected/unresolved-failed-update(4 failing cases across current and pre-migration locations). The failed run's terminal leaves its capture in place. Separately, with only the status change reverted,update statusreports the set asunresolved.update-command-capture-cleanup.test.ts6/6,update-automatic-cleanup.test.ts15/15,status.recovery.test.ts16/16. Negative controls: a failure with anactivatingreceipt, one with a repair attempt before activation, and one without a capture receipt all stay protected/unresolved, and an earlier successful update's capture is not superseded by the failure. Removing only the capture-receipt requirement makes the last control fail (4 cases).requested. Under this rule that is a never-activated failure, so they now recordstaging/validating/activatingto keep covering an activated failure.pnpm tsgo:core,pnpm tsgo:core:test, oxlint, oxfmt. The 25 related files pass (385 tests): terminal outcome/record/publication/triage/authority/unreported, failure recovery, run, recovery, cleanup recovery, execution validation, activation, already-current, the ledger and recovery suites, update-repair triage, the Doctor fleet preflight, the eager-import closure, and the upgrade-survivor no-op suite.update_runsrow from a real installation's ledger (87 runs written by released 2026.10.x builds) decodes with this branch. Exactly 2 qualify as never-activated: the two failed git updates that stopped atupdater-runtime-retentionwhile validating. None of the 6 activated failures, the 24 failed runs without a capture receipt, or the 55 succeeded/skipped runs qualify.scripts/tests/update-restart-module-outcome.mjsstubs the newfailedBeforeActivationcall withfalse, since its cases all fail after the swap (e51ff2d). Without the stub it fails with CI's error; with it, it passes.update-command-execution.ts, everything beforerecordPhase("activating")only inspects, validates candidate copies, takes backups, or retains the runtime, and the service stop andmutationStartedcome after that receipt. The 32 commits main gained during this work include fix(update): enter maintenance before repairing source artifacts #180356 (update finalizemaintenance ordering), which doesn't affect this flow.🤖 Generated with Claude Code