Skip to content

fix(update): warn when plugin migrations remain pending - #170392

Merged
steipete merged 1 commit into
mainfrom
upd/upd-l1579
Oct 12, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/upd-l1579

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

A successful update can leave acpx/codex data and settings upgrades pending without recording an actionable plugin warning in the update outcome. Skipped plugin updates report counts without their reasons.

Fixes #170334

User Impact

Updates continue best effort, with a final warning naming each plugin whose migration remains pending and the exact command to finish it. Skipped plugin updates also show their names and reasons. Pending work keeps its existing protection and Doctor's offline repair requirements.

Why This Change Was Made

Doctor-only and after-session migrations intentionally cannot complete in automatic Gateway mode. The update finalizer used the pending ledger to request Doctor but never checked the ledger afterward. It now records any remaining obligations through the existing Doctor advisory path, including when no plugin version changed; completed obligations produce no stale warning. The final message does not ask the operator to wait for the update that just finished.

This repair belongs to update finalization and reporting. It does not change migration execution, database schemas, backup/rollback behavior, or ownership authority. Existing installed updaters retain their own finalization behavior; updates that delegate plugin finalization to the candidate can consume the candidate fix.

Evidence

  • Both regressions failed before the fix for the intended reason: pending repairs returned ok, and the skipped-plugin summary omitted its reason.
  • node scripts/run-vitest.mjs src/cli/update-cli/update-command-fresh-doctor.test.ts src/cli/update-cli/update-command-plugins.persistence.test.ts --maxWorkers=1: 85 passed, 203.57 s total wall time. Finalizer file: 79 tests, 31.65 s wall / 19.401 s summed test time. Persistence file: 6 tests, 144.83 s wall / 45.815 s summed test time; cold compiler preparation dominates its wall time. New pending/cleared regressions took 34–35 ms; the skip-output case took 11.749 s through the existing real config/index fixture.
  • Runtime build passed: 154.1 s, including 54 built control-plane/Doctor modules.
  • Isolated Codex review of the functional diff: scoped-clean, P0–P2.
  • Production: +29 / -1 lines (net +28). Tests: +77 / -2 (net +75). Documentation: +3 / -1. Removed one stale max-lines baseline entry after verifying that its unchanged test file has 885 total lines, below the 1,000-line budget; the ratchet passes afterward.
  • All 23 importer files / 441 tests passed through the native Vitest wrapper with --maxWorkers=1: 2537.07 s wall time. Files were collected with rg -l 'update-command-fresh-doctor|update-command-plugins' --glob '*.test.ts' src extensions packages test; the two already-proven touched files were excluded from the second run.
  • node scripts/check-changed.mjs: passed all selected gates, including core and core-test typechecks, lint, formatting, ownership/SQLite ratchets, import cycles, and documentation checks. The initial runs caught the stale baseline entry and a test fixture literal widened to boolean; both were corrected without changing runtime behavior. PR CI timing is not available yet. No live operator Gateway, real update state, or published-binary upgrade was used. The tests cover the finalization boundary with shipped update markers and legacy/current parent and Doctor completion contracts.
Existing slow-test evidence

All passed. These untouched integration fixtures perform real Gateway startup or create isolated package/SQLite maintenance and rollback processes per scenario. Cold source/runtime preparation also contributes to wall time. These existing cases are unchanged; no timeouts, retries, assertions, or skips changed.

File Test Seconds
src/gateway/server-startup-plugin-quarantine.test.ts Gateway startup plugin quarantine > reaches readiness with a quarantined plugin beside a valid declared extension 60.202
src/cli/update-cli/update-command-database-rollback.test.ts restores pre-migration databases only before settled activation: package 35.218
src/cli/update-cli/update-command-database-rollback.test.ts restores pre-migration databases only before settled activation: git 31.748
src/cli/update-cli/update-command-database-rollback.test.ts restores pre-migration databases only before settled activation: git-edited 61.894
src/cli/update-cli/update-command-database-rollback.test.ts restores pre-migration databases only before settled activation: verification 52.908
src/cli/update-cli/update-command-database-rollback.test.ts restores pre-migration databases only before settled activation: convergence 49.858
src/cli/update-cli/update-command-database-rollback.test.ts restores pre-migration databases only before settled activation: started 36.689
src/cli/update-cli/update-command-database-rollback.test.ts restores pre-migration databases only before settled activation: unsettled 31.040
src/cli/update-cli/update-command-database-rollback.test.ts restores pre-migration databases only before settled activation: intervening 30.987
src/cli/update-cli/update-command-database-rollback.test.ts restores pre-migration databases only before settled activation: post-migration-write 46.637
src/cli/update-cli/update-command-database-rollback.test.ts restores pre-migration databases only before settled activation: config-refused 41.995
src/cli/update-cli.plugin-convergence.test.ts update-cli > fails unexpected post-core npm update exceptions 49.289

Recheck deferred plugin obligations after the final Doctor pass and keep
remaining upgrades visible as actionable Doctor advisories. Print skipped
plugin names and reasons alongside update summary counts.

Preserve migration ownership and best-effort core update behavior. Remove
one stale max-lines exemption after verifying the file is below its cap.

Fixes #170334
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review October 12, 2026 23:41
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: S labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR records actionable warnings for plugin migrations still pending after Doctor and prints skipped plugin names and reasons.

Example: ACPX and Codex migrations remain pending after post-update Doctor.

  • Before: The plugin outcome can remain successful without recording actionable migration warnings.
  • After: The outcome records a warning for each plugin with its recovery command, such as openclaw doctor --fix.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The implementation is focused and no concrete introduced defect was found, but the required shipped update behavior is unproven and the linked report is only partly covered.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: An update can omit actionable pending-plugin warnings and explain skipped plugin updates only through a count.
Reason: The maintainer-authored direction improves an existing reporting contract with little production machinery, while the linked report's completed-row warning scenario remains distinct.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR adds useful update diagnostics absent from current main, and no introduced correctness defect was found.

Priority: P2
Reviewed head: 80941580bb7a29e8044cafabb32aac37dfae4b01

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No shipped update run demonstrates pending advisories, cleared obligations, and skipped reasons through a published updater delegating finalization to this candidate; baseline failures are reported in the body but were not independently run.
Agent review details

How this fits together

Update finalization consumes plugin convergence outcomes and the canonical migration ledger, runs fresh Doctor, and produces plugin status and user-facing diagnostics before Gateway activation.

flowchart TD
  A[Update command] --> B[Plugin convergence]
  B --> C[Fresh Doctor]
  C --> D[Canonical migration ledger]
  D --> E[Plugin advisories]
  B --> F[Skipped plugin diagnostics]
  E --> G[Update outcome]
  F --> G
Loading

Technical review

Best possible solution:

Keep the reporting improvement and use Related rather than Fixes until the reporter's completed-migration case is confirmed resolved.

Do we have a high-confidence way to reproduce the issue?

Source establishes that successful Doctor execution can leave pending obligations without adding plugin advisories and that skipped outcomes previously printed only counts; the reporter's later completed-row case was not reproduced.

Is this the best way to solve the issue?

The existing finalizer, migration formatter, and convergence outcomes are appropriate owners for this reporting change, but it does not establish that already-completed historical warnings disappear.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against e4f463159d0a.

Provenance checked

  • Post-plugin Doctor advisory classification keeps the original intent (47be911: Allow recoverable post-plugin Doctor execution failures to remain warnings while preserving safety refusals and subsequent validation.)
  • Fresh Doctor for pending migrations keeps the original intent (8e66b0b: Finish pending migrations after install-record ownership is released, including unchanged packages, without discarding plugin settings.)
  • Update documentation keeps the original intent (81fd864: Complete deferred Doctor work for the admitted update and document the installed-parent versus candidate ownership boundary.)
  • Max-lines suppression baseline keeps the original intent (f81f9d8: Maintain a shrink-only inventory of existing oversized-file suppressions.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced production behavior: The pinned introduced diff adds a post-Doctor pending-ledger read, preserves the authority assertion, and appends existing doctor-advisory warning records without changing migration execution. (src/cli/update-cli/update-command-fresh-doctor.ts:612, 80941580bb7a)
  • Current main still lacks the reporting change: Current main checks pending migrations to decide whether Doctor should run, but does not reread them afterward; skipped outcomes are summarized only as counts. (src/cli/update-cli/update-command-fresh-doctor.ts:582, e4f463159d0a)
  • Reporter clarified a different final-state case: DonnieFi's latest discussion comment reports that every obligation was completed before Gateway startup, while the success summary repeated earlier unfinished warnings; adding warnings for genuinely pending rows does not establish resolution of that case.
  • Existing stale-warning owner: The shared resolver reconciles buffered warnings against the current pending set; the earlier merged repair explains why child-warning timestamps cannot establish whether work remains pending. (src/infra/deferred-plugin-migration-warnings.ts:2, e4f463159d0a)
  • Supplied validation boundary: The new finalizer cases mock both pending-ledger reads and Doctor execution. The full PR body reports passing focused and importer tests but explicitly states that no real update state or published-binary upgrade was used. (src/cli/update-cli/update-command-fresh-doctor.test.ts:64, 80941580bb7a)
  • Applicable repository policy: Root and docs policies were read and applied; no maintainer-notes directory exists. Root policy requires published-driver × candidate proof for update changes. The removed baseline entry is independently justified by the unchanged test file's 885 lines and absence of a max-lines suppression. (AGENTS.md, 80941580bb7a)

PR surface

Source +28, Tests +75, Docs +2, Other -1. Total +104 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 29 1 +28
Tests 3 77 2 +75
Docs 1 3 1 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 1 -1
Total 7 109 5 +104

Review metrics

Metric Value Why it matters
Production versus test growth Production +29/-1; tests and support +77/-2 The focused growth adds pending-versus-completed outcome coverage and skipped-reason output coverage without another production owner.

Labels

Label changes:

  • add P2: The change improves actionable update diagnostics while successful core updates and existing data remain intact.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab 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: The change improves actionable update diagnostics while successful core updates and existing data remain intact.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab 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 12, 2026, 7:47 PM ET / 23:47 UTC.

@steipete
steipete merged commit c016da9 into main Oct 12, 2026
198 of 201 checks passed
@steipete
steipete deleted the upd/upd-l1579 branch October 12, 2026 23:55
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…fter update (openclaw#170392)

After the update's Doctor pass, the finalizer rereads the deferred plugin-migration ledger; still-pending doctor-only/after-session migrations (e.g. acpx, codex) become per-plugin update warnings with the exact recovery command instead of a silent success. Skipped plugin updates now print each plugin and its skip reason. Fixes openclaw#170334.
RomneyDa added a commit that referenced this pull request Oct 14, 2026
…rades 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.
RomneyDa added a commit that referenced this pull request Oct 14, 2026
Replace this branch's adapted port of #170413 (72d5e35) with the semantic
adaptation used on release/2026.10.5 (46d65ed, cherry-picked from
7039a32). The release line lacks #170392
(post-plugin convergence reporting still-pending migrations as plugin
warnings), so drop the finallyReportedPluginIds supersede path: readiness
advisories can no longer retire a still-pending Doctor migration warning, and
the still-pending case is reported once as the final Doctor warning.

Backport adaptation: net of reverting 72d5e35 and cherry-picking 46d65ed; kept this branch's formatted doctor-health tests and triage test layout, which already matched 46d65ed semantically.
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.
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Oct 16, 2026
…rades as pending (openclaw#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 openclaw#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 adaptation: openclaw#170392 post-plugin pending-migration reporting is not on this branch, so the still-pending case stays a single final Doctor warning; dropped main-only deferredInspectionCheckIds publication and kept the branch's sync triage mocks and doctor-health imports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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.

[Bug]: acpx and codex data/settings upgrades still pending after a successful 2026.10.5-beta.2 update

1 participant