xdifu / codex-repair
PublicFix "Codex cannot access its local database" / "migration 1 was previously applied but has been modified" / "timed out waiting for state db backfill after 30s" on Codex Desktop (Windows/WSL/Mac/Linux) after the 0.130 → 0.131 update. CRLF/LF sqlx checksum drift in state_5.sqlite + logs_2.sqlite. Sessions preserved. See openai/codex#23787.
The Codex Repair Toolkit is a community-created open-source tool that fixes a specific crash affecting Codex Desktop users after an automatic update from version 0.130 to 0.131. The crash occurs because of two bugs: a database migration checksum mismatch caused by different line endings between Windows and Linux code, and a 30-second timeout that's too short for large conversation histories. The toolkit diagnoses these issues without touching anything, then safely repairs them with automatic backups, schema verification, and dry-run options. Your actual conversation history is never modified — only the internal bookkeeping databases are touched.
How It Works
Your Codex Desktop app suddenly won't start, showing an error about not being able to access its local database.
You discover that this is a known bug affecting many users after the automatic update, and this toolkit was created to fix it.
With one simple command, the tool scans your Codex installation and tells you exactly what's wrong — without changing anything.
Everything looks good — no action needed, your Codex should work normally.
The tool detected migration checksum mismatches and possibly stuck background indexing that need repair.
The tool automatically fixes the mismatched checksums and completes the background indexing, all while keeping backups of your data.
Your app launches successfully, all your chat history is preserved, and everything works exactly as before.
Star Growth
Repurpose is a Pro feature
Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.
Unlock RepurposeSimilar repos coming soon.