bug: Local sessions persist in filesystem but disappear completely from codex resume --all and Desktop Sidebar (SQLite index mismatch)
Open 💬 5 comments Opened Jun 13, 2026 by Atletico1999
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
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.
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
The recovery path should be able to rebuild a read-only session index from the JSONL files.
Each rebuilt row can carry session id, file path, parsed first/last timestamp, cwd/title if found, file mtime, parser version, and parse status. A malformed file should mark one row degraded, not prevent the sidebar/resume list from seeing the rest.
If direct resume by id works, the file set is still a valid source of truth.
---
_Generated with ax._
I fixed it successfully
None of the suggested fixes in this issue worked for me (clearing caches, reinstalling the app, etc.).
My Codex installation had been configured to use a custom gateway (I was using a reseller’s server connected to OpenRouter).
My original ~/.codex/config.toml contained:
model_provider = "gateway"
model = "claude-opus-4.8"
[model_providers.gateway]
name = "Gateway"
base_url = "http://45.136.205.7:3188/v1"
wire_api = "responses"
env_key = "OPENAI_API_KEY"
requires_openai_auth = false
supports_websockets = false
I edited it by changing:
model_provider = "openai"
model = "gpt-5.5"
and commented out the entire [model_providers.gateway] section.
Additionally, I downloaded and installed the previous Codex Desktop build:
https://persistent.oaistatic.com/codex-app-prod/Codex-darwin-arm64-26.602.71036.zip
After doing this:
I’m not sure which of these two changes actually fixed the issue (the configuration change, the older build, or the combination of both), but this is what worked in my case.
Adding a current Windows data point from the post-merge ChatGPT/Codex desktop builds. This still reproduces on the latest update available to this machine.
Environment:
26.707.12708.026.715.2305.0Observed behavior:
No chatsfor historical projects.limit: 49returns only 2 recent threads, despite 64 active rollout files being present.Backup-first workaround attempts that did not restore the sidebar on these builds:
.codex-global-state.json -> projectless-thread-idsto include all recoverable active IDs (95 IDs after preserving existing entries).limit: 49; it still returns only the same 2 recent threads.This appears to be deeper than project grouping or the old
limit >= 50regression: even a 49-item request does not enumerate the existing active sessions, while direct lookup by exact ID works. The durable rollout files remain a valid source of truth, but the current app does not backfill/reconcile them into the live thread listing.Please add a supported, non-destructive reindex/recovery path that scans
sessions/**/*.jsonl, validates each session independently, and reconstructs the list/sidebar metadata without requiring users to edit SQLite or remember thread titles/IDs.Hi @Atletico1999, your report looks related to a local session discovery/inventory gap rather than necessarily a lost rollout. I've released Codex Rescue Alpha5, a local read-only diagnostic tool that performs filesystem-first discovery across active and archived rollouts and cross-references SQLite/index metadata without modifying any state.
If you still have the affected local Codex directory, you can inspect it via:
No raw files or databases are needed. If you choose to share output, please review and sanitize any private repository paths or names first.