Codex Desktop hides searchable local threads and shows stale/recent dates after path migration
What happened
After local project path migration / session migration, Codex Desktop shows inconsistent thread history for local projects:
- Some historical threads exist on disk and can be opened by exact thread id, but they do not appear in the project sidebar or search results.
thread/list/ Desktop project grouping returns fewer threads thanstate_5.sqliteand the raw rollout store for the samecwd.- The Desktop UI sometimes displays many old conversations as recently updated (for example, "within 30 minutes"), even though the SQLite
created_at/updated_attimestamps are much older or only a small subset changed. - Pinning a thread by id makes some hidden threads visible, but search still may not find them by title.
This looks like an app-server / Desktop search-index / project-grouping cache issue rather than data loss.
Environment
- Codex Desktop app build:
26.602.30954(prod) - Bundled Codex CLI:
codex-cli 0.137.0-alpha.4 - OS: macOS 26.5.1 (25F80)
- Local state DB:
~/.codex/state_5.sqlite - Session store:
~/.codex/sessions/**/rollout-*.jsonl - Archived session store:
~/.codex/archived_sessions/*.jsonl
Evidence
The counts below were collected with a local read-only diagnostic comparing raw rollout files, SQLite, and app-server thread/list for exact cwd values.
Project A:
- raw rollout count: 30
- SQLite thread count: 30
- app-server thread count: 4
- explicit project config: true
- diagnosis: app-server filtering or metadata issue
- Desktop search for project-specific keywords returns no threads, while direct thread reads by id work.
Project B:
- raw rollout count: 60
- SQLite thread count: 60
- app-server thread count: 53
- explicit project config: true after adding config
- direct reads by id work, but global search by exact title sometimes returns no results.
Project C:
- raw rollout count: 6
- SQLite thread count: 6
- app-server thread count: 6
- direct thread reads work
- one interrupted thread could be opened by id but was not searchable by its title.
Example symptom:
read_thread(<thread_id>)succeeds and returns title/turns.list_threads(query=<exact title substring>)returns[]for the same thread.- Pinning that thread id succeeds and may make it visible in the sidebar.
Timestamp / date display issue
The Desktop UI showed many historical conversations as updated within the last ~30 minutes. A SQLite check did not fully match that display:
- total threads in SQLite: 273
- updated within 30 minutes at the time of check: 1
- updated within 2 hours: 5
- top repeated
updated_atvalues included older migration timestamps such as 2026-04-19 and 2026-04-18, plus a small repeated batch at 2026-06-05 09:42:03.
This suggests the UI may sometimes display a sidebar/index refresh time, project grouping metadata time, or app-server metadata time instead of the thread's own updated_at.
Why this seems like a bug
The underlying records are still present:
- raw rollout files exist
- SQLite
threads.cwdrows exist - direct reads by thread id work
But the Desktop sidebar/search and app-server project listing can hide or mis-date those same threads.
Expected behavior
For a local project cwd, if raw rollout files and SQLite agree, Codex Desktop / app-server should:
- show the same non-archived local threads in the project sidebar, or explain the active filter;
- find a thread by exact title substring in search;
- show the thread's actual
updated_at/ creation date, not an index refresh time; - keep behavior stable after path migration and app restart.
Actual behavior
- Project sidebar and search are incomplete.
- Direct id-based reads work while title search fails.
- Date display can show old threads as recently updated.
- Restarting the app can partially change the visible set, suggesting cache/index instability.
Notes
I am not attaching raw session transcripts or app logs here because they may contain private local paths and conversation contents. I can provide sanitized diagnostics or submit feedback through the in-app /feedback flow if needed.
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Additional sanitized finding and local mitigation:
I found a strong trigger for the wrong updated-time behavior. A local metadata/text migration had touched many Codex session JSONL files without changing the actual conversation end time. After that, Desktop/app-server showed many old conversations as recently updated at the same few seconds.
Evidence from the affected machine:
threads.updated_atvalue in~/.codex/state_5.sqlite.state_5.sqlitestill had the correct per-thread updated timestamps.list_threadsreturned many old threads with updatedAt equal to the clustered filesystem mtime values.read_threadby id worked, but some title searches did not find the thread.Local mitigation tested:
threads.updated_at; did not modify file contents or the SQLite DB.list_threadsordering improved immediately, the previously hidden thread appeared in the recent list, and exact title search found it again.Hypothesis:
Desktop/app-server is using session JSONL filesystem mtime, or an index derived from mtime, as
updatedAt/ recency/search freshness in at least some paths. This makes history ordering fragile when local migration, backup, or text rewrite tools touch session files. The app should derive conversation recency from session content orstate_5.sqlitethread metadata, not file mtime alone.Additional sanitized dot-directory project finding:
After restoring session file mtimes, normal workspace project history recovered much better. However, projects whose cwd is a dot-directory under the home directory still show search/list inconsistencies.
Observed examples:
/Users/ray/.codex: raw rollout count 3, SQLite thread count 3, app-server project diagnose count 3, explicit project config true after adding[projects."/Users/ray/.codex"]. Directread_threadby id succeeds for all 3. But globallist_threadssearch for terms from those thread titles, such asMCPorcodex name, returns no results./Users/ray/.openclaw: raw rollout count 20, SQLite thread count 20, app-server project diagnose count 19 active threads (the missing one is archived), explicit project config true after adding[projects."/Users/ray/.openclaw"]. Directread_threadby id succeeds, but global search forOpenClaw/openclaw 配置returns no results.This suggests a remaining Desktop/app-server indexing or global-search issue for hidden/dot-directory project cwd values, even when raw storage and app-server project-level diagnosis can see the threads.
Additional Windows evidence confirms a three-layer inconsistency between canonical thread storage, the app-server list/catalog, and the renderer sidebar.
Environment:
OpenAI.Codex 26.715.4045.00.145.0-alpha.18Observed:
local_thread_cataloghad no row for that thread; its sync state showedinitial_build_complete=0andwatermark=null.list_threadsinitially omitted the thread even though canonical storage could read it.list_threadsto return the thread again, but the already-running renderer sidebar still did not display it.No Codex thread found, then succeeded after the index/list state refreshed, confirming that the thread itself had never been missing.No manual SQLite or global-state write was performed, and there was no data loss.
This suggests that canonical storage, the derived local catalog, the app-server list response, and renderer membership can diverge independently. A supported catalog rebuild/refresh path and explicit diagnostics for missing catalog rows would make this recoverable without state surgery.