Repository navigation
fix: keep updates moving when optional cron inspection or snapshot cleanup fails - #170754
Conversation
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
b0cee4a to
4a7bac4
Compare
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR lets optional dreaming inspection and settled snapshot cleanup failures warn without stopping recovery, while preserving independent failure causes. Example: A cron inventory read succeeds, but removing its disposable snapshot fails with EACCES.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it is maintainer-authored and fixes recovery failures still present on main; no actionable introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherUpdate invokes Doctor, which inspects persisted cron rows through maintenance-owned readers or snapshot workers; Memory Core consumes that inventory and returns repair plans or recoverable warnings. flowchart TD
A[Update CLI] --> B[Doctor maintenance]
B --> C[Cron inventory owner]
C --> D[Admitted reader or snapshot worker]
D --> E[Persisted cron rows]
C --> F[Memory Core repair plan]
D --> G[Canonical snapshot cleanup]
F --> B
Technical reviewBest possible solution: Keep optional recovery work visible and retryable while preserving required migration, write-authority, and worker-retirement failures. Do we have a high-confidence way to reproduce the issue? Current main throws when snapshot removal fails after a successful read and lets finally cleanup overwrite an earlier read failure; the supplied native-worker regressions target both paths, but no target code was executed during this review. Is this the best way to solve the issue? The patch fixes the owning boundaries using existing maintenance, warning, cleanup, and aggregation contracts, while leaving classification, backed-up writes, and final authority checks intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1a5f3774fcdc. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +63, Tests +61, Docs +7. Total +131 across 8 files. Added test files: 0. View PR surface stats
Review metrics
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 October 13, 2026, 6:41 PM ET / 22:41 UTC. |
|
Merged via squash.
|
…eanup fails (openclaw#170754) * fix: keep updates moving through optional cron inspection failures * fix(cron): preserve inspection failures through cleanup * test(cron): prove both failure causes through native workers
…ions and optional cron cleanup (#171818) * fix(update): success summary repeats settled plugin data/settings upgrades as pending (#170413) * fix(update): retire settled plugin migration warnings from update reports Doctor's config preflight reports a plugin data/settings upgrade as pending, then post-session plugin repairs (acpx, codex) can settle it later in the same pass. The stale warning still reached the updater, which persisted it as a run warning and repeated it in the success summary with "Let the current update finish" guidance after the update had finished. - Doctor drops warnings the ledger shows settled before publishing its update result (new doctor-health-update-result sibling keeps doctor-health under cap). - Finalization retires persisted warning rows a later pass settled or superseded, so the run record and report match the pending ledger. - Post-core convergence is the last migration pass: guidance now says to run the repair command instead of waiting. - The post-core plugin summary names the reason for each informational skip. Fixes #170334 * fix(update): publish an empty warning list when every plugin migration settled * fix(update): leave skipped plugin reasons to the post-core summary owner * fix(update): report a still-pending plugin migration once after post-plugin convergence * test(update): type the settled plugin warning expectation * fix(update): keep warning guidance compatible with recovery bootstrap * fix(doctor): omit absent diagnostics from update publication (cherry picked from commit 7039a32) Backport note: the release line lacks #170392 (post-plugin convergence rereading the ledger and reporting pending migrations as plugin warnings) and the main-only deferredInspectionCheckIds Doctor capture. Dropped the finallyReportedPluginIds supersede path so readiness advisories cannot retire a still-pending Doctor migration warning, omitted deferredInspectionCheckIds from the publication helper, kept the release-line Doctor intro/outro, and adapted the resume-completion test: a still-pending migration is reported once as the final Doctor warning. (cherry picked from commit 46d65ed) Backport adaptation: ported to the 2026.9.33 extended-stable line from the 2026.10.5 adaptation of main's #170413. The 9.33 line has no doctor-health-startup.js or install-owner.js, so doctor-health keeps its release-line exit path and only imports the new publication helper; the config change logging moved with the helper, retiring doctor-health's inline formatUpdateDoctorConfigChange/createSubsystemLogger imports. The helper carries no deferredInspectionCheckIds capture. The 9.33 triage tests are parametrized per update marker; their post-core-convergence cases now expect direct repair guidance, while package-swap cases keep "Let the current update or repair finish". * fix: keep updates moving when optional cron inspection or snapshot cleanup fails (#170754) * fix: keep updates moving through optional cron inspection failures * fix(cron): preserve inspection failures through cleanup * test(cron): prove both failure causes through native workers (cherry picked from commit 1864a74) Backport adaptation: partial backport to the 2026.9.33 extended-stable line. Takes the memory-core dreaming cron inspection catch, the cron read-only snapshot cleanup change (a completed read survives deferred cleanup; a failed read keeps both the inspection and cleanup failures), and the cleanup tests. Drops the store-repair.ts maintenance-reader reuse hunk and its doctor/cron/index.test.ts case, which need #162200 (absent here; 9.33 keeps Doctor cron inspection in src/cron/store/doctor.ts), and drops the matching reader-reuse sentence from the update docs. The 9.33 cold-cleanup test predates main's fault-injection support, so it is adapted in place: its read case completes and now resolves while the registered snapshot retries through cleanupSnapshotOperations, and its copy case asserts the aggregate of the worker copy failure and the snapshot cleanup failure.
What Problem This Solves
Fixes updates and Doctor recovery failing when optional dreaming cron inspection is unavailable or a successful cron read cannot remove its disposable snapshot. If inspection and cleanup both fail, diagnostics now retain both causes.
User Impact
Core recovery can continue with existing cron rows retained and optional dreaming repair visibly pending; retry with
openclaw doctor --fix. Failed reads/writes, required migration obligations, and unconfirmed worker closure remain failures. No schema, durability, retention, or configuration contract changes.Why This Change Was Made
Offline Doctor borrows its already admitted maintenance reader after the backup boundary. Optional inspection uses the plugin's existing recoverable-warning contract and retains a repair plan. Once all readers retire, disposable removal refusal warns and remains with canonical cleanup custody. The cron owner preserves inspection and retirement errors together instead of letting
finallyoverwrite the first failure.This resilience fix does not establish the cause of Scott's original allocation-plus-close aggregate; its nested errors were not supplied.
Evidence
The two real-worker regressions failed against the original
finally: read-query and snapshot-copy failures were overwritten by disposal refusal. On the fixed owner, both causes remain visible, source bytes remain intact, and canonical cleanup later removes retained snapshots. The final five cron cleanup cases passed in 54.12 seconds (read/copy test time 1.21/0.95 seconds), including genuine worker-close refusal and successful-read disposal deferral.Unchanged offline Doctor inventory, dreaming retry, and maintenance settlement proof passed 75 tests on the same production tree. Deferred migration and updater-child boundaries passed two files, 29 tests, 126.01 seconds. Main SQLite/update fixes cited by the report passed eight suites, 111 tests, 200.63 seconds. The first focused invocation paid cold compiled-worker preparation; no sleeps, process boots, or production test seams were added.
The changed dreaming test file took 50.85 seconds; the first case pays the existing real plugin SDK/host import cost (43.06 seconds). The Doctor cron suite shares real database/worker lifecycle proof; its new admitted-reader case took 1.36 seconds. These protect plugin/maintenance boundaries that a mocked planner cannot prove.
Fresh canonical Codex autoreview at P1 was scoped-clean; independent maintainer review approved the final real-worker test cutover. Final changed gates pass types, lint, format, and ownership guards. The dead-export scan alone remains red for the unchanged main export
pruneExpiredDevicePairSetupCompletions; it is recorded as inherited, with no suppression. Current-head aggregate CI is green.Canonical package build and integrity passed at
8a2d46231eeae36c4df2f0b6c3cc279564d2c5aa; SHA2565aeced9a79414dff9ad2a0997ccf641b1f56d6bad54f6bd513110b56c054f21b. Supported published 2026.9.6 dreaming-cron-doctor updater × candidate proof passed in 516 seconds, covering the real optional memory-core owner, backed-up cron partition repair, preserved survivor IDs/order, repeat Doctor idempotence, and healthy installed Gateway. The container did not inject allocation/cleanup faults; native-worker regressions above provide that separate owning-boundary proof. Plugin Doctor host certification additionally passed 10 tests in 46.42 seconds, including recoverable warnings retaining required migration debt. No live Gateway or operator state was changed.