Repository navigation
fix(sqlite): validate state before writable setup - #104952
Merged
Merged
Conversation
Member
Author
|
Land-ready verification for Behavior proof:
Validation:
Known gap:
The local changed gate scoped the patch to |
Member
Author
|
Merged via squash.
|
This was referenced Jul 12, 2026
This was referenced Jul 12, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Shared-state initialization configured SQLite journaling and schema state before proving that table/index contents were internally consistent. A stale secondary index could therefore survive
PRAGMA quick_checkand reach writable runtime, doctor repair, or startup checkpoint setup.This also needs to preserve SQLite crash recovery: a read-only preflight cannot recover a hot rollback journal after an interrupted writer.
Refs #71689
Why This Change Was Made
quick_checkplusintegrity_checkimmediately after recovery and before any OpenClaw-owned pragma, schema, repair, or checkpoint mutation.quick_check=okwhileintegrity_checkcatches missing index rows.User Impact
OpenClaw now refuses to initialize or repair a shared state database whose table/index state is inconsistent, without blocking normal SQLite crash recovery. Corruption evidence is preserved for operator recovery instead of being followed by further application writes.
Evidence
tbx_01kxa82b1e9x5aa41yq01exk84(quick-crab): 170/170 focused state, migration, and doctor tests passed on the patch-identical pre-final-rebase head.OPENCLAW_TESTBOX=1 scripts/pr prepare-run 104952passed hosted gates for PR headfa09521458ce8db10ba03da2acd3b42105cfa845.pnpm check:changedscoped the patch tocore, coreTests; all patch-specific checks passed. The repository-wide Plugin SDK API baseline check currently reports hash drift independent of these two state files.