Repository navigation
fix(update): settle recovery when the handoff lease database is missing - #165238
Conversation
Recreate an absent handoff coordination store through its existing owner, then settle obsolete package custody as recovery-lease-missing under a fresh executor fence. Preserve recovery evidence and completed receipts, including interrupted archival when a recreated file reuses its old inode. Keep live-owner and unsafe-path refusals intact. Extend the public repair fixture and document the existing Doctor migration continuation. Reported by @Hensarj and @dawid-sitko in #164254.
|
🦞👀 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: blocked before merge. Reviewed October 4, 2026, 9:16 PM ET / October 5, 2026, 01:16 UTC. ClawSweeper reviewWhat this changesThe PR lets update repair recreate a missing coordination database, archive orphaned package recovery safely, and permit another update. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 4 items remain The missing-database recovery is still needed on current main. The patch addresses the reported failure, but two interruption cases can leave recovery blocked, and published-updater compatibility evidence remains incomplete. Priority: P0 Review scores
Verification
How this fits togetherPackage activation tracks an interrupted package installation and its recovery artifacts. Update repair uses the coordination database to acquire exclusive ownership before settling those artifacts and continuing maintenance. flowchart TD
A[Update repair] --> B[Read recovery journal]
B --> C[Inspect coordination database]
C --> D[Recreate missing store]
C --> E[Acquire fresh update ownership]
D --> E
E --> F[Archive retained recovery]
F --> G[Record completion]
G --> H[Continue Doctor and next update]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +37, Tests +49, Docs +9. Total +95 across 7 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep one recovery owner that durably remembers lease loss across every interruption and safely completes both new and already-started settlements without changing installed package bytes. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the missing-store failure on current main and two retry failures in the proposed patch; this review did not execute them. Is this the best way to solve the issue? The existing custody owner is the right repair boundary, but the patch must preserve lease-loss provenance before recreation and when resuming an older supersession intent. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a2affcf76e93. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…ng (openclaw#165238) Closes openclaw#164254 Reported by @Hensarj and @dawid-sitko.
Backport all required recovery fixes to 2026.10.1: #167302, #167330, #167358, and #167377. Include their missing settlement prerequisites #164997, #165238, and #165607. Close obsolete recovery custody durably before best-effort evidence archival; keep unfinished rollback and current mutation authority strict. Completed history cannot block subsequent updates. Qualify authentic interruptions from pinned 9.8/9.9 updaters plus the unchanged 9.7-to-9.8 negative control. Adapt donor APIs to the release-owned publication and lease database owners. No version, dependency, budget, permission, or publication changes. Proof:619 focused tests passed, including14 release-profile cases; fresh complete69-file P0-P2 review clean. Complete changed gate passed. Exact combined release build and stable/all/soak qualification remain pending. Sources: 3ed1e21 (#167302) 4821885 (#167330) 8879e5e (#167358) bc860ad (#167377) 9497527 (#164997) 5ae6497 (#165238) fb84dd5 (#165607) Co-authored-by: Scott Hanselman <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…eanup (#167564) Adds recovery regressions for the three ways OS temp cleanup removes the managed-update handoff lease database (missing file, recreated parent directory, replacement inode), as reported in #167506 and #167557: recovery settles and admits the next package preparation. Main already settles these via #165238 and #164849; 2026.9.9 does not include them. Refs #167506 #167557.
…eanup (openclaw#167564) Adds recovery regressions for the three ways OS temp cleanup removes the managed-update handoff lease database (missing file, recreated parent directory, replacement inode), as reported in openclaw#167506 and openclaw#167557: recovery settles and admits the next package preparation. Main already settles these via openclaw#165238 and openclaw#164849; 2026.9.9 does not include them. Refs openclaw#167506 openclaw#167557.
What Problem This Solves
Fixes
openclaw update repairfailing withupdate-recovery-pendingwhen a reboot or temporary-filesystem cleanup removes the recorded handoff lease database.Closes #164254. Thanks @Hensarj and @dawid-sitko for the reports and diagnostics.
User Impact
Repair from a CLI containing this fix recreates the missing coordination store through its existing owner, closes the orphaned package operation as
recovery-lease-missing, and admits the next update. It retains recovery evidence and leaves the installed package and launchers intact. Another live update owner still prevents settlement.Repair then reaches the existing Doctor/plugin-convergence flow. Deferred migration warnings clear only when the plugin owners complete their work; this does not claim that all migrations on the reporters' installations have been verified. An older installed updater needs the documented manual installation hop before using the new repair.
Why This Change Was Made
The replacement recovery added in #164849 captures the current database identity before acquiring its recovery fence. A missing file throws ENOENT before that settlement can begin. This extends the same package-custody owner and completion receipt handling, without a second recovery path or a SQLite schema change.
Linux can reuse the deleted database's inode. The recorded missing-lease intent therefore survives an interrupted archival attempt, so retrying cannot mistake the recreated store for the original authority. Fresh executor ownership still fences every custody change; dangling symlinks and unrelated filesystem errors are not treated as an absent store.
Evidence
settlePendingPackageActivation(12 passed, 1 failed). The cold macOS run took 365.81 seconds, dominated by transformation; compiled-worker preparation alone took 165.03 seconds.tbx_01m44q9bttxqyejs1ad0ycdvve, run environment: candidate HEAD and all seven changed file checksums verified before execution, with isolatedOPENCLAW_STATE_DIR.pnpm test src/cli/update-cli/update-repair-package-activation.test.ts --maxWorkers=1, three runs: 16/16 passed each. Runner wall time: 21.81 / 9.05 / 8.94 seconds; measured test work: 2.209 / 2.247 / 2.278 seconds. Covers missing/replaced stores, retained artifacts, next preparation, live-owner refusal, interrupted archival with deterministic inode reuse, and dangling-symlink refusal.rg -l 'package-update-activation' --glob '*.test.ts' src extensions packages test, plusupdate-command-resume-completion.test.tsanddoctor-config-preflight.plugin-deferral.test.ts: 527 passed, 13 existing platform-specific cases skipped, 273.24 seconds across five routed shards. The skips require Linux root or macOS; no test was added to a skip list. The registeredupdate repairDoctor continuation and plugin-owned data migration fixtures pass. No reporter live state or Raspberry Pi was used.node scripts/check-changed.mjs --base 678572811dd8b10c19ee69e2107947d099dd33c1: exit 0 on the same Testbox (22m47.401s), including core types, all 27 core test type graphs, lint, and ownership/storage guards. The explicit base avoids the hydrated Testbox's staleorigin/mainselecting unrelated changes. Local changed-file formatting andgit diff --checkalso pass. The repository source-snapshot wrapper stalled before allocation; the installed Crabbox CLI used the same Testbox provider, with a frozen-lockfile dependency install and per-file source checksums.Production: +45/-8 lines; tests: +57/-8; documentation: +9/-0. No production module was added or removed.