Repository navigation
fix: report newer schemas before catalog repair errors - #166906
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. Reviewed October 7, 2026, 10:43 PM ET / October 8, 2026, 02:43 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR reports an unsupported database version before catalog-repair guidance when shared-state read admission fails. Example: An older build reads schema 21 with a malformed legacy index
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review This PR repairs a diagnostic defect still present on current main. No actionable code or security findings remain; the previous packaged-updater proof request does not apply to this diagnostic-only repair. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherOpenClaw validates its shared SQLite state database before allowing read operations. Failed admission returns recovery guidance and closes the reader without exposing database contents. flowchart TD
A[Shared state database] --> B[Read-only admission]
B --> C{Catalog readable?}
C -->|Yes| D[Existing schema validation]
C -->|No| E[Read published version]
E --> F{Version supported?}
F -->|No| G[Compatible build or backup guidance]
F -->|Yes or unavailable| H[Original catalog diagnostic]
Technical reviewBest possible solution: Keep the existing reader owner and cached successful path, selecting compatible-build guidance when the independently readable published version is unsupported. Do we have a high-confidence way to reproduce the issue? Yes: current source admits the catalog before version validation, so a malformed legacy index masks the future-version refusal. The reported failing reader and Doctor regressions corroborate this; no tests were executed during this read-only review. Is this the best way to solve the issue? Yes: the failure-only fallback reuses the established version reader and error type without adding successful-read queries or changing repair authority. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d327a36593da. Provenance checked
TestingProof path: in-process harness. Added test files: 1. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +19, Tests +33, Docs +5. Total +57 across 3 files. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label 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 HistoryReview history (1 earlier review cycle)
|
|
This matches the newer-schema diagnostic failure I reproduced on |
Restores the actionable newer-schema refusal ahead of catalog admission (regressed in openclaw#165921). Proven with a published-driver (2026.9.8) x candidate cell.
…elease and keep status reads read-only (#166963) Follow-up to #166906: Doctor --fix, Gateway startup, offline database preflight and update status now give one install-compatible-build / restore-backup answer for a database written by a newer release, and update status no longer creates SQLite sidecars.
…elease and keep status reads read-only (openclaw#166963) Follow-up to openclaw#166906: Doctor --fix, Gateway startup, offline database preflight and update status now give one install-compatible-build / restore-backup answer for a database written by a newer release, and update status no longer creates SQLite sidecars.
Fixes #166899
What Problem This Solves
Shared-state reads can recommend
openclaw doctor --fixwhen the database requires a newer OpenClaw build. Catalog admission encounters an unreadable index before checking the supported numeric schema version, so the catalog error hides the more useful version refusal.The existing Doctor regression exposes this through an ordinary
listUpdateRuns()call in its setup. The actual Doctor admission path already refuses incompatible state before stopping the Gateway.User Impact
Readers report the newer schema version and direct operators to a compatible build or their pre-update backup. Supported-version catalog failures retain their existing guidance. This changes no schema, stored data, migration, or successful-read query budget.
Why This Change Was Made
#165921 admitted reusable catalog facts before checking supported versions. On failed admission, the reader now checks the independently readable published version before choosing its diagnostic. If that header check is unavailable, it preserves the original catalog error. Successful admission retains its existing cached-facts path.
Doctor's own
openDoctorStateSchemaReadAdmissionalready permits bounded inspection of the recognized legacy index before its existing version checks. That admission, installed-updater handoffs, driver markers, version publication, rollback, and activation ownership are unchanged. The relevant compatibility proof is the reader refusal and existing pre-stop Doctor coverage; this repair introduces no changed driver–candidate interaction requiring a new packaged-updater scenario.Evidence
The original Doctor file reproduced with 44 passing cases and one failure during author validation. A diagnostic continuation past its failing setup assertion confirmed that actual Doctor admission still refused before service stop. The final patch preserves that test and every assertion unchanged. An independent Cloud Mac replay on
109bd479also reproduced the same future-version assertion while the future-content and supported-version controls passed; that replay was stopped after recording the failure and controls.Both added real-SQLite regressions exercise the reader admission APIs against an unsupported version and unreadable catalog, requiring the version-specific refusal, no callback execution, and unchanged database bytes. They fail on the original implementation. The changed file passed all 19 tests locally during author validation (19.48 seconds wall, including worker preparation).
Author-reported Linux Testbox validation passed all 384 tests in 33 Doctor-maintenance and schema files, including the original 45-case file, core production types, and all 27 core test type graphs. The new cases took 0.14 seconds combined.
Required CI on this head passed. Its reader and schema job independently confirms all 19 cache tests, both new regression cases, 39 schema-policy tests, and eight existing-schema tests passing. Formatting, lint, production/test types, structural checks, and security checks passed in the same run. Independent engineering review and the separate automated source review found no actionable defects.
[email protected], shared-stateuser_versionraised 19 → 21 with the test's unreadable-index mutation, then each path run from builds of this head and main be4c0b1.doctor --json: main says "migration required; run Doctor repair", this head reports the newer schema with install-compatible-build / restore-backup guidance.update status --json: main errors recommend Doctor repair, this head reports the newer schema. No committed SQLite file changed hash or mtime on either side, and nothing was stopped.doctor-maintenance.finish-revalidation.test.ts: 44 passed / 1 failed on main, 45 passed here. Remaining pre-existing gaps (also present on main and in published 2026.9.8) are tracked separately: the Doctor--fixrecovery tail and a Gateway registry warning still append "Doctor repair" advice,update status --jsoncreates an empty WAL and a SHM file, and offlinedatabase preflightchecks integrity before the schema version.