You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: ocx doctor reports a false history integrity failure when state_5.sqlite is WAL without -shm #7044
ocx doctor reports "backup manifest or restore target failed integrity checks — manual review required" when Codex's state_5.sqlite is a WAL database with no live writer (no -wal/-shm files). countPendingOpencodexHistory (src/codex/history-provider.ts:1834) opens the DB with new Database(path, { readonly: true }); SQLite cannot open a WAL database read-only without -shm (SQLITE_CANTOPEN). The error is not classified as recoverable and falls through to failureReason: "integrity".
openCodexStateForPreflight (src/codex/history-state-open.ts:86) already handles exactly this case with an ?immutable=1 fallback (from #4943), but countPendingOpencodexHistory does not use it.
Reproduction
Quit all Codex processes so ~/.codex/state_5.sqlite-wal and -shm are gone.
sqlite3 "file:$HOME/.codex/state_5.sqlite?mode=ro" "SELECT 1 FROM threads LIMIT 1" → unable to open database file (14).
ocx doctor → integrity warning under "Codex native-write coordinator".
On a machine where Codex is running (WAL files present) the same check prints ok.
Open the state DB in countPendingOpencodexHistory via openCodexStateForPreflight(stateDbPath) (or classify SQLITE_CANTOPEN without WAL files as "busy"/unknown instead of "integrity").
Fixed on dev by #7060 (5b6bff7): the pending-history count now opens state_5.sqlite through openCodexStateForPreflight, so a WAL database with no -wal/-shm files no longer reports a false integrity failure in ocx doctor. It ships in the next release after 2.84.0.
Activity
lidge-jun commentedon Oct 13, 2026
Fixed on dev by #7060 (5b6bff7): the pending-history count now opens state_5.sqlite through openCodexStateForPreflight, so a WAL database with no -wal/-shm files no longer reports a false integrity failure in ocx doctor. It ships in the next release after 2.84.0.