[Bug]: ocx doctor reports a false history integrity failure when state_5.sqlite is WAL without -shm
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- sqlite, typescript
Research direction
Start with countPendingOpencodexHistory in src/codex/history-provider.ts and compare its database opening with openCodexStateForPreflight in src/codex/history-state-open.ts, which handles WAL databases without -shm. Check the existing tests for these paths, then add coverage for a WAL state database without -shm; done means ocx doctor no longer reports a false integrity failure for that case.
Written by the indexing model from the issue text.
Description
Client or integration
Codex CLI
Area
CLI
Summary
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-waland-shmare 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.
Version
@bitkyc08/opencodex 2.84.0, codex-cli 0.162.1
Operating system
macOS 27 (Apple Silicon)
Provider and model
n/a
Logs or error output
Codex native-write coordinator
-- backup manifest or restore target failed integrity checks — manual review required
Redacted configuration
Client mode, no history backup entries pending.
Proposed fix
Open the state DB in countPendingOpencodexHistory via openCodexStateForPreflight(stateDbPath) (or classify SQLITE_CANTOPEN without WAL files as "busy"/unknown instead of "integrity").
Related: #4943.
Screenshots and supporting files
No response
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.3k
- Avg merge
- 7h 50m
- Merged PRs (30d)
- 645
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lidge-jun/opencodex
-
[Bug]: Business Premium seat plan self_serve_business_prolite is counted at baseline capacity weight 1 instead of 5Possibly taken A pull request linked to this issue is open or already merged. Openaccount-pool bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
lidge-jun/opencodex#7440 · 2 comments ·
Maintainers usually reply within 1 day
-
[Docs]: translate the #7395 OpenGateway and Mistral provider-guide sectionsPossibly taken @MannXo claimed this 1 day ago. Opendocumentation
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
lidge-jun/opencodex#7405 · 3 comments ·
Maintainers usually reply within 1 day
-
[Bug]: resolveCodexRuntime test depends on the host's installed CodexPossibly taken A pull request linked to this issue is open or already merged. Openbug cli
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
lidge-jun/opencodex#7403 · 2 comments ·
Maintainers usually reply within 1 day
-
account-pool enhancement needs-design proxy
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
lidge-jun/opencodex#6737 · 1 comment ·
Maintainers usually reply within 1 day
-
bug streaming
Difficulty 4/5 3-5 days Newbie friendliness 45/100
lidge-jun/opencodex#7462 · 4 comments ·
Maintainers usually reply within 1 day
All issues in lidge-jun/opencodex
Similar issues
-
ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
xavxyz/bei-shan-lin-shui#57 ·
Maintainers usually reply within 1 day
-
[BUG] rag: sentence content can cross the reported sentence boundariesPossibly taken @LJK-ikun claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
README: the Resource URI Schemas example's file://documents/* pattern only matches that literal URIOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
platformatic/mcp#361 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
siyuan-note/siyuan#20799 · 7 comments ·
Maintainers usually reply within 1 day