Repository navigation
fix(plugins): preserve newer schema errors - #125493
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Merged via squash.
|
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 9:36 PM ET / August 18, 2026, 01:36 UTC. ClawSweeper reviewWhat this changesThe PR makes plugin install-index reads rethrow newer SQLite schema errors while retaining their existing handling for malformed or unavailable plugin records. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep this PR open: current main still masks the database-owned newer-schema error as invalid plugin state or a missing index, while the branch preserves the actionable compatibility diagnostic through both affected readers. Priority: P2 Review scores
Verification
How this fits togetherPlugin discovery and startup read the installed-plugin index from OpenClaw’s shared SQLite state. The read-only database boundary rejects newer schemas before exposing records; plugin readers then feed either normal registry loading or actionable operator diagnostics. flowchart LR
A[Plugin startup or CLI] --> B[Plugin index reader]
B --> C[Read-only state database]
C --> D{Schema supported?}
D -->|No| E[Newer-schema guidance]
D -->|Yes| F[Validate plugin records]
F --> G[Registry or Doctor guidance]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +15, Tests +49. Total +64 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase this narrow owner-boundary repair, retain the two real-SQLite regressions, and land it once exact-head checks confirm the current main merge result. Do we have a high-confidence way to reproduce the issue? Yes, from source: a database with user_version above the supported state schema throws before row access, and current main’s catches collapse that error; the supplied regressions enact this with a real SQLite database, though they were not run in this read-only review. Is this the best way to solve the issue? Yes. Preserving the database boundary’s terminal error at both plugin-index reader boundaries is narrower and safer than teaching downstream callers to distinguish a misleading invalid-record result. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6f6691c9a61a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Follow-up to #125115 and #125133.
AI-assisted: yes. I reviewed the implementation and proof.
What Problem This Solves
Older OpenClaw builds correctly refuse a shared SQLite database created by a newer schema, but plugin install-record inspection caught that compatibility error and relabeled it as corrupt plugin metadata. Operators saw
Persisted plugin install records are invalideven when the records were valid and the real action was to update the stale build.Why This Change Was Made
SQLite schema compatibility remains owned by the database boundary. A shared
isSqliteSchemaVersionErrorguard now preserves that terminal error through both plugin-index read paths, while malformed plugin rows, missing state, and other unreadable index cases keep their existing soft classifications.The same guard replaces duplicate string checks in shared and per-agent database open failure handling.
Provenance: the generic install-record failure path was introduced by #121045 (
1471881af7aa, authored and merged by @vincentkoc) and made operational for schema-8 readers when #124728 (4bc37cd59761, authored and merged by @steipete) advanced shared state to schema 9. The sibling catch-to-null path came from #119228 (ef11eae39b29, authored and merged by @vincentkoc).User Impact
A stale CLI now reports the database path, observed and supported schema versions, refusing install identity, upgrade/rebuild or alternate-state-directory remediation, and database-schema documentation. Truly malformed plugin install records still produce the existing Doctor repair guidance.
Production LOC:
+21/-6(net+15) for the canonical compatibility-error guard and two owner-boundary rethrows. Tests:+49/-0.Evidence
The focused regressions failed before the production fix for the intended reasons: the install-record loader emitted the generic invalid-record message and the full index reader resolved
null(54 unaffected tests passed). After the fix:Rebased intended-head proof: Blacksmith Testbox
tbx_01m097cx2xwx94jr0zy1wd6vjj, https://github.com/openclaw/openclaw/actions/runs/32087981638Changed-surface format, typechecks, lint, dead exports, import cycles, plugin boundaries, and database guards passed on Blacksmith Testbox
tbx_01m0968g3p66etxy5x79g5vhb3: https://github.com/openclaw/openclaw/actions/runs/32086773934Source-blind CLI behavior validation passed both clauses on Blacksmith Testbox
tbx_01m097kje0d3sfv5emw9zxk419: https://github.com/openclaw/openclaw/actions/runs/32088201788install_records_jsonretained the existing invalid-record Doctor diagnostic.Final branch autoreview completed clean with no accepted/actionable findings, confidence 0.99.