Skip to content

fix: keep updates moving when optional cron inspection or snapshot cleanup fails - #170754

Merged
RomneyDa merged 3 commits into
mainfrom
fix/update-doctor-cron-resilience-20261012
Oct 13, 2026
Merged

RomneyDa merged 3 commits into
mainfrom
fix/update-doctor-cron-resilience-20261012

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

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 finally overwrite 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; SHA256 5aeced9a79414dff9ad2a0997ccf641b1f56d6bad54f6bd513110b56c054f21b. 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.

@RomneyDa
RomneyDa marked this pull request as ready for review October 13, 2026 06:54
@clawsweeper

clawsweeper Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment @clawsweeper review. Please avoid repeated requests while a review is queued or running; agents should not request reviews automatically.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: memory-core Extension: memory-core commands Command implementations size: S labels Oct 13, 2026
@RomneyDa
RomneyDa force-pushed the fix/update-doctor-cron-resilience-20261012 branch from b0cee4a to 4a7bac4 Compare October 13, 2026 21:37
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 13, 2026
@clawsweeper

clawsweeper Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The caller receives a cleanup error instead of the successfully loaded inventory.
  • After: The caller receives the inventory, a warning records deferred cleanup, and the canonical cleanup owner retains the directory for retry.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, focused recovery fix with production-owner integration coverage, preserved safety boundaries, and green exact-head CI.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; native-worker tests cover the changed cron owner, and the body reports an isolated published-2026.9.6 updater run, but supplies no inspectable shipped-entry-point fault-recovery artifact.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Optional cron inspection or disposable snapshot removal can stop Doctor recovery or discard a usable cron inventory.
Reason: The maintainer-authored direction follows the existing update contract and restores useful recovery behavior without new configuration or a public API.

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
Reviewed head: 8a2d46231eeae36c4df2f0b6c3cc279564d2c5aa

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The reported published-updater run did not inject allocation or removal faults, so shipped CLI recovery under those faults is not demonstrated.
Agent review details

How this fits together

Update 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
Loading

Technical review

Best 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

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction and current-main behavior: The introduced diff changes optional inspection, maintenance-reader reuse, cleanup disposition, and error aggregation. The three production modules remain unchanged between the merge base and fetched main, so main still contains the original failure paths. (src/cron/store/read-only.ts:173, 1a5f3774fcdc)
  • Cleanup preserves successful reads and failed retirement: Worker closure must succeed before snapshot release. Removal refusal becomes a warning only after a successful read; failed reads and cleanup failures are retained together using the existing lifecycle aggregation helper. (src/cron/store/read-only.ts:109, 8a2d46231eea)
  • Existing maintenance owner: Doctor borrows the existing maintenance reader only when live-source reads have been admitted; the reader checks current scope and database identity and remains registered for maintenance drainage. (src/commands/doctor/cron/store-repair.ts:130, 8a2d46231eea)
  • Pending repair and authority remain enforced: The plugin host rechecks repair authority after migration returns, excludes warning-producing plugins from completion certification, and keeps nonrecoverable failures blocking. (src/infra/state-migrations.plugin-doctor.ts:338, 8a2d46231eea)
  • Owning-boundary regressions: Native-worker fault fixtures exercise query/copy failures plus removal refusal, assert both causes and unchanged source bytes, and verify later cleanup; separate cases retain worker-close rejection and successful-read results. (src/cron/store.readonly-worker-cold-cleanup.test.ts:85, 8a2d46231eea)
  • Related report and scope limit: [Bug] Cron read-only snapshot cleanup throws without rollback guard #147956 reports the same successful-read cleanup failure. anhnt3 later supplied a Docker virtiofs reproduction and named-volume workaround; this PR does not establish that the broader recursive-discovery startup loop is resolved.

Likely related people:

  • Peter Steinberger: Raw commit 49b3315 adds src/cron/store/read-only.ts:175 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 49b331576760; files: src/cron/store/read-only.ts)
  • Vincent Koc: Raw commit 467fc82 adds src/cron/store/read-only.ts:161 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 467fc82c4fd9; files: src/cron/store/read-only.ts)
  • Dallin Romney: Raw commit 0c6d0e9 adds docs/cli/update/how-updates-run.md:104 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 0c6d0e9d325c; files: docs/cli/update/how-updates-run.md)

PR surface

Source +63, Tests +61, Docs +7. Total +131 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 69 6 +63
Tests 4 65 4 +61
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 141 10 +131

Review metrics

Metric Value Why it matters
Production versus test LOC Production +69/-6; tests +65/-4 Growth covers three related recovery boundaries and extends existing fixtures without adding production test seams.

Labels

Label changes:

  • add P2: This is a focused recovery reliability fix for optional inspection and disposable cleanup failures; no urgent incident is causally established.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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:

  • P2: This is a focused recovery reliability fix for optional inspection and disposable cleanup failures; no urgent incident is causally established.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 October 13, 2026, 6:41 PM ET / 22:41 UTC.

@RomneyDa
RomneyDa merged commit 1864a74 into main Oct 13, 2026
145 checks passed
@RomneyDa
RomneyDa deleted the fix/update-doctor-cron-resilience-20261012 branch October 13, 2026 22:43
@RomneyDa

Copy link
Copy Markdown
Member Author

Merged via squash.

RomneyDa added a commit that referenced this pull request Oct 14, 2026
…eanup 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)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
…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
RomneyDa added a commit that referenced this pull request Oct 14, 2026
…eanup 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)
RomneyDa added a commit that referenced this pull request Oct 14, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation extensions: memory-core Extension: memory-core P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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