Repository navigation
fix: prevent SQLite lock stalls and schema drift - #108663
Conversation
180e5d8 to
8b9ae93
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 180e5d8ee8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
9905168 to
31e7d2b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31e7d2bb7b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
31e7d2b to
e03cca9
Compare
|
Merged via squash.
|
* fix: harden SQLite state storage * build: allow strict SQLite migration SQL * test: align SQLite and model-default assertions
* fix: harden SQLite state storage * build: allow strict SQLite migration SQL * test: align SQLite and model-default assertions
What Problem This Solves
Resolves a problem where OpenClaw's SQLite-backed state stores applied inconsistent safety guarantees: some schemas accepted invalid value types, WAL activation could fail silently, and a memory cache copy held SQLite work across an asynchronous yield. Those gaps could turn ordinary contention or upgrades into lock stalls, schema drift, or partially enforced invariants.
Why This Change Was Made
This applies the relevant safeguards from the SQLite Editions audit across the shared state DB, agent DB, and touched plugin-owned databases. It adds versioned atomic
STRICTmigrations that preserve rows, indexes, triggers, views, implicit rowids, foreign keys, andAUTOINCREMENThigh-water marks; verifies WAL activation and network-storage policy; bounds managed-handoff lock waits; and keeps all write transactions synchronous.Logbook writes now use relational constraints and checked row counts, Memory Core copies cache rows in committed materialized pages, and filesystem mtimes retain sub-millisecond precision. No new config or compatibility fallback is introduced.
User Impact
Operators get deterministic SQLite upgrades, stronger on-disk invariants, and shorter lock ownership during concurrent work. Existing valid state is migrated in place. Invalid or unsafe schema transitions fail clearly instead of silently weakening storage guarantees.
Evidence
git diff --checkpassed.pnpm buildpassed, including tsdown, public Plugin SDK declaration verification, CLI bootstrap guards, bundled assets, and Control UI performance budgets.pnpm check:changedreached the repository's pre-existing current-main max-lines ratchet failure forsrc/agents/live-cache-regression-runner.ts; this PR does not touch that file or its baseline.AI-assisted. I reviewed the complete change and validation evidence.