Repository navigation
fix(doctor): unblock verified session migrations with pending plugins - #153097
Conversation
|
🦞👀 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 September 19, 2026, 6:37 PM ET / 22:37 UTC (Revision 6). ClawSweeper reviewWhat this changesDoctor reuses verified session-import receipts, permits plugin settlement after legacy inputs are archived, returns success for warning-only checks, and reports actionable migration refusals. Merge readiness⛔ Blocked before merge - 2 items remain The fix remains necessary on current main, and no introduced correctness or security defect was found. The recorded maintainer disposition addresses the prior updater-rehearsal request while preserving its explicit coverage limitation. Priority: P2 Review scores
Verification
How this fits togetherDoctor migrates legacy session files into OpenClaw’s SQLite stores and preserves originals needed by pending plugins. Its verification results determine repair completion, plugin configuration unlock, and diagnostics consumed by the updater. flowchart TD
A[Legacy session files and archives] --> C[Doctor session verification]
B[Existing import receipts] --> C
C --> D{Sources verified?}
D -->|No| E[Preserve inputs and report refusal]
D -->|Yes| F[Canonical SQLite sessions]
F --> G[Plugin inspection and settlement]
G --> H[Configuration unlock and Doctor result]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +57, Tests +256, Docs +13. Total +326 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: 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:
Technical reviewBest possible solution: Keep verified receipts authoritative, preserve inconsistent originals, and let the existing plugin settlement owner release retained configuration. Do we have a high-confidence way to reproduce the issue? Yes: current-main source exposes the retained-path omission and archive-only prerequisite failure, and the PR records published-package reproductions. This reviewer did not execute the runtime. Is this the best way to solve the issue? Yes: the patch repairs the existing receipt and diagnostic owners without adding storage formats or bypassing plugin completion checks; the broader updater proof exception is explicitly documented. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c5ad7506abae. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
Use verified retained source receipts when reporting historical transcripts on retries and read-only checks. Share migration warning classification with the Doctor CLI so pending plugin inputs remain warnings while uncaptured or changed sources stay visible.
Use existing historical archive receipts when no live session inputs need deferral, allowing the post-session plugin owner to complete its ledger and release retained configuration. Preserve actionable refusal for unverifiable live inputs and carry refused step facts into Doctor diagnostics.
5735a89 to
f7cc37e
Compare
|
Correction after inspecting the complete saved log: The pinned install ended with Additional downstream Docker upgrade evidence from a recoverable Synology deployment:
The remaining proof should run the published updater/state path against a candidate built from this PR head, then verify migration completion, Codex plugin completion, configuration unlock, preserved session/event counts and archive hashes, and successful finalization. Service restoration is separately owned by the downstream recoverable updater. @clawsweeper re-review flowchart TD
A[Healthy production: 2026.9.3] --> B[Clone retained state]
B --> C[Test published 2026.9.5]
C --> D[Doctor first]
C --> E[Plugin first]
D --> F[Migration remains pending<br/>Codex package does not converge<br/>GatewayLockError]
E --> G[Codex 2026.9.5 install starts<br/>then exits with openat2 ENOSYS]
F --> H[Restore original 9.3 container and state]
G --> H
H --> I[Production remains healthy]
J[PR #153097 candidate] --> K[Still needs published-updater-to-candidate rehearsal]
K --> L{All gates pass?}
L -->|Yes| M[Eligible for maintainer release]
L -->|No| N[Keep 9.3 and retain rollback evidence]
|
|
Merged via squash.
|
…openclaw#153097) Doctor can reject verified session SQLite migrations while a plugin remains pending, reporting false transcript errors or leaving plugin configuration locked after the legacy index is retired. Reuse verified receipt source identities, accept verified archive-only prerequisites when no live legacy inputs remain, and let the existing post-session plugin owner settle migration and unlock retained configuration. Warning-only session commands exit successfully; genuine refusals preserve their actionable failure facts across Doctor and update reporting. Schemas, retention, dependencies, and options are unchanged. Fixes openclaw#153079. Fixes openclaw#152744. Thanks @berklingtools for the recovery report and @wiipud and @ozp for diagnosing the index-free prerequisite failure. Additional pinned-plugin validation followed @ericpearson's Docker report. Validation: published 2026.9.5 and candidate CLI fixtures preserved session/event counts, archive hashes, and SQLite integrity; candidate Doctor completed the pending plugin row and unlocked retained config. The 78 focused owner tests, 24 shard tests, changed-file checks, and exact-head CI passed. The scoped review was clean and both rebased commits are patch-identical to the reviewed versions. Full published-updater-to-candidate finalization and Linux service-restoration proof remain unperformed; service restoration is tracked separately in openclaw#153017.
Rebuild retained source evidence from recorded hashes without replaying canonical sessions. Protect changed inputs by name and classify vanished legacy indexes as informational when SQLite transcript contents prove completion, allowing post-session plugin repair to finish. Related: #152884. Follow-up to #153097. Thanks @cpsleepy and @mmm7053455-tech for the recovery evidence.
Rebuild retained source evidence from recorded hashes without replaying canonical sessions. Protect changed inputs by name and classify vanished legacy indexes as informational when SQLite transcript contents prove completion, allowing post-session plugin repair to finish. Related: #152884. Follow-up to #153097. Thanks @cpsleepy and @mmm7053455-tech for the recovery evidence.
Rebuild retained source evidence from recorded hashes without replaying canonical sessions. Protect changed inputs by name and classify vanished legacy indexes as informational when SQLite transcript contents prove completion, allowing post-session plugin repair to finish. Related: #152884. Follow-up to #153097. Thanks @cpsleepy and @mmm7053455-tech for the recovery evidence.
Rebuild retained source evidence from recorded hashes without replaying canonical sessions. Protect changed inputs by name and classify vanished legacy indexes as informational when SQLite transcript contents prove completion, allowing post-session plugin repair to finish. Related: #152884. Follow-up to #153097. Thanks @cpsleepy and @mmm7053455-tech for the recovery evidence.
…d files (#153655) Doctor now recovers verified session imports when the original legacy index is missing, a restored source has a different inode, or the import database has been replaced. The receipt owner verifies hashes and ordered canonical transcript events before refreshing existing receipt evidence; conflicting sources remain protected, and current session settings and deletions remain authoritative. Gateway readiness can admit usable SQLite stores while retained inputs await Doctor repair. Readiness does not grant archival authority. Recovery reports include remaining issue codes without claiming successful validation. Published 2026.9.4 and 2026.9.5 updater cells cover missing indexes, copied sources, and replaced databases, preserving transcripts, hashes, schemas, and SQLite integrity. Reordered replacement history remains refused. No schema, dependency, configuration, or CLI option changes. Thanks @cpsleepy, @mmm7053455-tech, @blackeyes-boy, and @Albertyn87 for the reports and recovery evidence. Fixes #152884. Fixes #153606. Fixes #153619. Follow-up to #153097.
…d files (openclaw#153655) Doctor now recovers verified session imports when the original legacy index is missing, a restored source has a different inode, or the import database has been replaced. The receipt owner verifies hashes and ordered canonical transcript events before refreshing existing receipt evidence; conflicting sources remain protected, and current session settings and deletions remain authoritative. Gateway readiness can admit usable SQLite stores while retained inputs await Doctor repair. Readiness does not grant archival authority. Recovery reports include remaining issue codes without claiming successful validation. Published 2026.9.4 and 2026.9.5 updater cells cover missing indexes, copied sources, and replaced databases, preserving transcripts, hashes, schemas, and SQLite integrity. Reordered replacement history remains refused. No schema, dependency, configuration, or CLI option changes. Thanks @cpsleepy, @mmm7053455-tech, @blackeyes-boy, and @Albertyn87 for the reports and recovery evidence. Fixes openclaw#152884. Fixes openclaw#153606. Fixes openclaw#153619. Follow-up to openclaw#153097.
What Problem This Solves
Doctor can reject verified session SQLite migrations while a plugin remains pending, leaving recovery reports full of false transcript errors or keeping plugin configuration locked after the legacy session index is gone.
Fixes #153079. Fixes #152744. Thanks @berklingtools for the recovery report and @wiipud and @ozp for diagnosing the index-free prerequisite failure.
User Impact
Verified core migration completes while remaining plugin inputs receive one actionable warning. Warning-only session commands exit successfully. Once no live legacy inputs remain, the plugin's post-session inspection can complete its pending migration and unlock retained configuration. Genuine source inconsistencies still refuse; Doctor now names the failing check, code, reason, and recovery action.
Why This Change Was Made
Retries rebuilt retained paths from the old index and forgot transcripts discovered outside it. Doctor now consumes their verified receipt identities. Archive-only targets already have verified move receipts, so they no longer demand a new receipt for a nonexistent live index. Plugin completion stays with the existing post-session owner; no empty source receipt or new storage shape is introduced.
The existing warning classification also drives CLI exit status. Refusal facts now belong to the Doctor error/report owner and reach the halt message, health warnings, and update result consistently. Schemas, retention, dependencies, and options are unchanged.
Gateway restoration after a refused Doctor run remains tracked separately in #153017. This PR does not change service lifecycle behavior.
Evidence
The published npm package
[email protected]reproduced the 297-issue report using 296 synthetic transcripts and an absent codex plugin. The repaired import, inspect, and validate commands exit 0 with one pending-plugin warning, preserving 296 sessions, 592 events, and the exact original files and 148 codex sidecars.A second isolated 9.5 fixture has two canonical SQLite agent stores, no live
sessions.jsonor JSONL files, and protected historical archive inventory. With a lightweight plugin fixture declaring post-session inspection, publisheddoctor --fixexits 1 and config remains locked. The candidate's actualdoctor --fixexits 0; the codex pending row becomes completed with a finish timestamp, and the public config edit succeeds. Both databases retain their events, passquick_check, and all four archived files retain their hashes. The full Linux upgrade/service-restoration paths were not exercised.The archive-only regression failed before the owner fix, the inconsistent-source case failed its actionable-message assertion, and the refused-step reporting regression failed because failure facts were absent from warnings. Final migration/retained-source/discovery suites passed 55 tests; reporting owner/sibling suites passed 23. The existing receipt-retry cases remain green.
node scripts/check-changed.mjspassed, and fresh P1 autoreview is scoped-clean.Incremental change: production +53/−34 LOC (net +19), tests +201/−3 (net +198), docs +7. Whole PR: production +139/−82 (net +57), tests +323/−67 (net +256), docs +13. Existing regression coverage was moved and extended; no line-limit exceptions or baseline changes were added.
The branch is rebased onto main containing
4396f9bb39a(#153004), which supplies the gateway test-shard rebalance. This PR carries no partition or inventory changes. The shard regression passes all 24 tests on the rebased branch. Both Doctor commits are patch-identical to the versions ending at2079585929a; the PR production changes are unchanged. Rebase validation also passed all 78 focused owner tests andnode scripts/check-changed.mjs(including production and core-test typechecks). The prior production review is reused because the patches are unchanged.Additional external pinned-plugin validation, prompted by @ericpearson's Docker report: with two verified SQLite agent stores, no live legacy index/transcripts, an absent Codex plugin, and a retained pending migration row, the actual
plugins install --pin --force npm:@openclaw/[email protected]command exits 0 with the pending warning on both published 2026.9.5 and this head. Repeating the candidate's force-pinned install also exits 0 while the row remains pending. Subsequentdoctor --fixexits 0 and records the row completed with a finish timestamp; a retained plugin-config edit then succeeds. Both agent databases retain one session and two transcript events and passquick_check. The install exit owner (plugins-install-command.ts) already distinguishes failed installs from these recoverable preflight warnings; startup keeps the warning without blocking readiness. No additional source change was needed.This is macOS CLI proof with the real official package and isolated synthetic state, not the exact Synology Docker/Btrfs 2026.9.3-to-2026.9.5 image rehearsal or a real model smoke. The reporter's particular exit 1 remains unconfirmed; the quoted pending warnings alone did not reproduce it. Initial source-checkout proof hit bundled/external Codex shadowing and a stale update-result marker; fresh external-only fixtures corrected those rig settings. Additional regression validation recorded 64 passes, then a 120-second Doctor-case timeout and a following worker-scope/registry failure. The affected Doctor/startup pair passed in its original order without concurrent package work (116.5s and 9.1s), using the unchanged timeout and assertions. The other 64 cases were already green. Slow multi-preflight test performance and timeout isolation remain a named follow-up; the current logs do not identify the slow subphase. No production or test LOC changed, so the existing review and changed-file checks remain applicable.
ClawSweeper review disposition
The exact-head review completed at 22:03 UTC on September 19 found no introduced correctness or security defect. Its rank-up move requests a published-updater-to-candidate rehearsal of retained session state and successful finalization. That additional rehearsal is skipped for this bounded, explicitly authorized landing of the reviewed patch. The standalone published-package/candidate Doctor and pinned-plugin evidence above is retained; it does not establish the complete updater/service-restoration path. The compatibility proof gap remains explicit, with service restoration tracked separately in #153017. No production, test, schema, retention, option, or dependency change was made in response to this disposition.