Repository navigation
fix(plugins): defer startup registration until data migrations finish - #178165
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: needs maintainer review before merge. What this changesThis PR prevents plugin replacement code from running while its recorded data migration remains unfinished. Example: The pending-data-fixture plugin version 2.1.0 requires Doctor to migrate retained records.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses a current migration-admission gap, preserves existing recovery behavior, and has no actionable code findings. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe plugin loader consumes selected manifests, configuration, and migration obligations to produce executable registries or actionable unavailability diagnostics; Doctor continues to own migration and backup. flowchart TD
A[Startup or reload] --> B[Plugin loader]
C[Migration ledger] --> B
B --> D[Unavailable diagnostic]
B --> E[Plugin registry]
F[Doctor repair] --> C
Technical reviewBest possible solution: Keep migration admission in the existing loader and repair in Doctor, preserving predecessor recovery and retry after completion. Do we have a high-confidence way to reproduce the issue? Current-main source permits replacement evaluation despite a recorded state-migration obligation; the supplied regression models that path, but no target code was executed during this review. Is this the best way to solve the issue? The patch is a focused repair using the existing ledger, diagnostics, loader, and Doctor owners; the simplify and test-value passes found no unnecessary production machinery or duplicate regression group. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5b1e93eaef0e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +110, Tests +233, Docs +6. Total +349 across 7 files. Added test files: 1. View PR surface stats
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 20, 2026, 2:56 AM ET / 06:56 UTC. |
|
Merged via squash auto-merge.
|
Read ordinary deferred-plugin readiness through the live state read worker and retain results under the migration owner's process receipt and database engine. Invalidate on committed ledger changes while preserving the pending-data registration gate and explicit snapshot scopes. Three alternating baseline/candidate pairs reduce the readiness family from 226 SQL statements / 42 requests / 5 MAIN statements to 41 / 10 / 0. Warm causal work stays 46 / 11 / 0. Retain one cold read per Gateway/catalog isolate; unrelated state writes no longer discard settlement. Preserve and extend the retained-data migration regression from #178165. 162 focused tests, PostgreSQL conformance, static CI, two isolated reviews and the published-driver update check pass. Record the source-key namespace guarantee for session-import recovery. Co-authored-by: Dallin Romney <[email protected]>
…openclaw#178165) * fix(plugins): defer startup registration until data migrations finish * fix(agents): await plugin admission in prepared catalogs * test(gateway): keep worker Goal fixture on async registry path
Read ordinary deferred-plugin readiness through the live state read worker and retain results under the migration owner's process receipt and database engine. Invalidate on committed ledger changes while preserving the pending-data registration gate and explicit snapshot scopes. Three alternating baseline/candidate pairs reduce the readiness family from 226 SQL statements / 42 requests / 5 MAIN statements to 41 / 10 / 0. Warm causal work stays 46 / 11 / 0. Retain one cold read per Gateway/catalog isolate; unrelated state writes no longer discard settlement. Preserve and extend the retained-data migration regression from openclaw#178165. 162 focused tests, PostgreSQL conformance, static CI, two isolated reviews and the published-driver update check pass. Record the source-key namespace guarantee for session-import recovery. Co-authored-by: Dallin Romney <[email protected]>
What Problem This Solves
Fixes: restarting before Doctor finishes a plugin data migration evaluates the replacement against unmigrated data, leaving the plugin broken even though the Gateway can become ready.
User Impact
Plugins awaiting a recorded data migration stay unavailable with an actionable Doctor diagnostic, without evaluating replacement code. Reload refuses the replacement before stopping the working predecessor. Stop the Gateway, run
openclaw doctor --fixagainst the same state and config, then start it again.Why This Change Was Made
Cold runtime admission consumes the existing migration obligation. Admitted instances remain reusable; refused registries are not cached, so Doctor completion allows a retry in the same inventory. Doctor remains the migration and backup owner.
The PostgreSQL CI follow-up moves ordinary prepared-catalog loading onto the existing asynchronous plugin loader, preserving cached registries, primary-registry callbacks, and donor adoption. It does not use inspection-only resource ownership or weaken the worker-only database guard. Explicit synchronous callers retain their existing adapter.
No schema, persisted format, runtime config option, or plugin SDK option changes. Main only; no separate 10.3 backport.
Evidence
449e694e6252using the existing PostgreSQL model-catalog conformance test and the CI-pinned PostgreSQL 17 image. The stack reached the synchronous migration-readiness read from prepared-catalog construction. The corrected route passes both SQLite and PostgreSQL cases (2 tests; 46.33 seconds wall time including schema verification and worker preparation).pnpm buildcompleted successfully in 5m 8.2s, including the CLI bootstrap import guard.git diff --checkpassed.plugins inspect --runtime --jsonrefused evaluation while preserving exact data/config bytes; offlinedoctor --fix --yescompleted the migration; a fresh built CLI process loaded the retained IDs, ages, and operator settings.8b8577faea6eis pending; old-head CI is not evidence for the final head.Validation limits
test/scripts/ci-node-test-plan.test.ts:3297(../../scripts/lib/ci-test-timings.mts). The same failure reproduces against the unchanged index. The three repaired mock factories have explicit isolation reasons, and only their three obsolete grandfathered entries were removed.chat-message.test.tsx,config-page-state.ts,sessions-page-state.ts).The simplify/test-audit pass retains the existing admission, diagnostic, registry, and migration owners. The CI repair adds 27 production lines and removes 2, adds 12 fixture-adapter lines, and removes 3 mock-baseline entries; it adds no persistent state or new cache.