bug: Local sessions persist in filesystem but disappear completely from codex resume --all and Desktop Sidebar (SQLite index mismatch)
Open 💬 4 comments Opened Jun 13, 2026 by Atletico1999
What issue are you seeing?
Historical conversation sessions have completely disappeared from both the Codex Desktop App sidebar and the codex resume --all command line utility.
However, our debugging reveals a critical synchronization contradiction based on the following verified facts:
- Data Assets Intact: Both the
session-index.jsonand thesessionsdirectory still physically exist with all historical session files intact underC:\Users\Administrator\.codex\. --allDiscrepancy: Runningcodex resume --allreturns empty or only displays newly created test sessions, completely failing to recognize the historical.jsonlfiles in the subdirectory.- ID Passthrough Works: If I manually extract a 36-character UUID from the first line of any raw
.jsonlfile, runningcodex resume <Session_ID>works perfectly and successfully restores the conversation history. - Index Regeneration Failure: If I delete
session-index.json,state_5.sqlite,state_5.sqlite-shm, andstate_5.sqlite-wal, and then relaunch Codex, thestate_5.sqlite,state_5.sqlite-shm, andstate_5.sqlite-walfiles are regenerated, butsession-index.jsonis NOT re-created. The application completely fails to back-scan the historical files, leaving the sidebar entirely empty (except for the active test session).
What steps can reproduce the bug?
We performed a series of rigorous test cases to isolate the bug. Here are the exact steps and results:
Test Case A: Direct Resume and Exit
- Extract a valid historical ID from
~/.codex/sessions/. - Run
codex resume <Session_ID>to enter the conversation successfully. - Type
/exitimmediately to quit the session. - Run
codex resume --all.
- Result: The session does not appear in the list. It is still hidden.
Test Case B: Content Injection via Placeholder (Short Text)
- Enter the session via
codex resume <Session_ID>. - Input a dot
.as a placeholder message and press Enter. - Type
/exitto quit. - Run
codex resume --all.
- Result: The session still does not appear in the list.
Test Case C: Content Injection via Real Conversation (Long Text)
- Enter the session via
codex resume <Session_ID>. - Input a long, realistic human conversational sentence (e.g., a multi-word prompt) to trigger a full model response, ensuring an active interaction event occurred.
- Type
/exitto quit. - Run
codex resume --all.
- Result: Even after a successful long-text interaction and graceful exit, the session still fails to register back into the --all list or the desktop sidebar. It remains completely invisible unless called explicitly by its absolute ID.
What is the expected behavior?
- When
state_5.sqliteis missing or regenerated, the Codex background daemon should automatically deep-scan the~/.codex/sessions/directory, parse all existing local.jsonlfiles, and properly rebuild the global index database. - Manually resuming an existing session via
codex resume <Session_ID>—regardless of whether it's an immediate exit, a short placeholder input, or a long-text conversation—should instantly force the background database to register or update that session's metadata into the active index (state_5.sqlite) so that it becomes visible globally.
Additional information
- Environment: Windows 11 (Root path:
C:\Users\Administrator\.codex) - Core Discovery: This issue highlights a severe regression in the local database routing and event persistence layers. The SQLite indexing mechanism seems to actively ignore or filter out historical local files on startup and refuses to commit them back to the global state database even after explicit physical interaction and write events occur during a manual resume.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗