Codex Desktop project sidebar shows No chats while local sessions still exist
Bug Report: Codex Desktop project sidebar shows "No chats" even though local sessions still exist
Summary
Codex Desktop is showing several saved projects with No chats in the project sidebar, even though the corresponding local session files and session_index.jsonl entries still exist on disk.
This appears to be a project-to-thread indexing issue, not actual session data loss.
Environment
- Product: Codex Desktop
- Originator from session metadata:
Codex Desktop - CLI version from session metadata:
0.130.0-alpha.5 - Source from session metadata:
vscode - OS: Windows
- Date observed: 2026-05-15
User-visible behavior
Several projects in the sidebar show No chats, for example:
build-and-test-in-pipelinesInstaller_taskformacionesscope wizard
However, local session data still exists under the Codex home directory.
Expected behavior
Saved projects should show their related chats when the underlying session files and session index entries still exist.
If the project/thread hint cache is missing or incomplete, Codex Desktop should rebuild the mapping from durable sources such as:
session_index.jsonl- session
session_meta.cwd - persisted thread permissions / writable roots
- saved workspace roots
The UI should not show No chats for projects that still have recoverable local thread metadata.
Actual behavior
The project sidebar shows No chats for projects that still have local chat/session data.
Local inspection found that:
session_index.jsonlstill contains the affected thread IDs and names.- Session
.jsonlfiles still exist under.codex/sessions. - Some older sessions are intentionally under
.codex/archived_sessions. .codex-global-state.jsoncontains many thread permissions with validsandboxPolicy.writableRoots.- But top-level
thread-workspace-root-hintscontains only a very small subset of thread-to-project mappings.
This makes the UI appear as if chats disappeared, while the durable data is still present.
Evidence from local state
Local diagnostic script results:
- Existing
thread-workspace-root-hints:4 - Missing candidate project/thread hints recoverable from persisted state:
58 - Skipped archived sessions:
12 - Skipped already-associated hints:
3
Candidate recovered groups included:
scope wizard:20threadsExplore and route:13threadsformaciones:3threads- additional projects with 1-2 threads each
The global state also had remote-project-connection-backfill-completed: true, so if a backfill/migration is intended to repair this mapping, it may be incorrectly marked complete or may not cover this state shape.
Likely area to investigate
The sidebar grouping appears to depend on top-level thread-workspace-root-hints.
In this case, many thread IDs have enough persisted metadata to infer their project roots from:
electron-persisted-atom-state.heartbeat-thread-permissions-by-id[*].sandboxPolicy.writableRoots
electron-saved-workspace-roots
session_index.jsonl
.codex/sessions/**/rollout-*.jsonl session_meta.cwd
But those thread IDs are absent from:
thread-workspace-root-hints
Impact
This is confusing and potentially risky:
- Users can believe their chat history has been lost.
- Existing context becomes hard to discover from the project sidebar.
- Users may attempt unsafe manual cleanup/reinstall steps despite the sessions still being present.
- Project continuity is affected for long-running work split across repositories.
Suggested fix
Codex Desktop should make project/thread mapping resilient to missing or stale thread-workspace-root-hints.
Possible fixes:
- Recompute missing hints at startup from durable session metadata.
- Treat
thread-workspace-root-hintsas a cache, not the source of truth. - If
remote-project-connection-backfill-completedis true but hints are clearly incomplete, rerun a safe incremental backfill. - Include archived-session awareness so archived threads are not unintentionally reintroduced into normal project lists.
- Add a repair/migration path that uses canonical saved workspace roots when a thread writable root points to a Codex-managed worktree.
Temporary workaround used locally
A local dry-run PowerShell script was prepared to reconstruct missing hints from persisted state without modifying anything by default.
The script:
- Reads
.codex-global-state.json. - Reads
session_index.jsonl. - Reads
.codex/archived_sessionsto avoid reactivating archived threads. - Proposes missing
thread-workspace-root-hintsfromheartbeat-thread-permissions-by-id. - Resolves Codex worktree roots back to canonical saved workspace roots when possible.
- Only writes changes when executed with an explicit
-Applyflag. - Creates a timestamped backup before writing.
This workaround has not been applied yet; it was only used to confirm that the missing associations are recoverable.
Attachments / artifacts available
- Dry-run report:
codex-thread-workspace-hints-report.json - Local repair script:
Repair-CodexThreadWorkspaceHints.ps1
These can be shared if needed, after reviewing/redacting local paths and thread names.
9 Comments
I ran into the same class of issue after a Codex Desktop update: the local session data still existed, but the project sidebar/UI no longer associated the old threads with the project.
I collected the recovery workflow I used here:
https://github.com/huajiexiewenfeng/codex-session-recovery
It is an unofficial workaround, not an upstream fix. The workflow is intentionally conservative: it runs a dry-run first, checks
session_index.jsonl,.codex-global-state.json, SQLitethreads.cwd, project/sidebar mappings, Windows\\?\path mismatches, creates timestamped backups before writing, and verifies the result afterward.This may help in cases like this issue where
sessions/**/*.jsonl/session_index.jsonlstill exist but the Desktop sidebar showsNo chatsbecause project/thread mapping state is incomplete or stale.I have an additional workaround/diagnostic observation that may help narrow this down.
Environment
codexCLI on PATH:codex-cli 0.128.0CODEX_HOME: default~/.codex~/.codex/state_5.sqlite~/.codex/session_index.jsonl~/.codex/.codex-global-state.json~/.codex/sessions/**/rollout-*.jsonlThe affected thread metadata in
state_5.sqlitehadsource='vscode',model_provider='openai', and for the test threadcli_version='0.131.0-alpha.9'.Observed behavior
I saw the same class of issue on macOS Codex Desktop:
~/.codex/state_5.sqlite.~/.codex/sessions/....For one affected project, local DB inspection showed:
threads.cwd = '/Users/<user>/repository/reweighting'But Codex Desktop showed no visible threads for that project.
Workaround / diagnostic
A workaround that restored the missing project threads was:
No chats.state_5.sqliteand find active thread IDs withthreads.cwd = <that project path>.targetThreadId.I reproduced this twice:
In the second case, the hidden project had 13 active threads in
state_5.sqlite; after sending a one-shot heartbeat to one existing hidden thread in that project, the project threads reappeared in the Desktop sidebar.Interpretation
This suggests the issue does not appear to be data loss. Causing new activity on an existing hidden thread seems to refresh or re-register the Desktop sidebar/project mapping for that thread/project.
This is not a clean fix because it writes a small message into the target thread, but it is useful as a diagnostic. It suggests the missing state may be recoverable by rehydrating or refreshing per-thread activity/mapping state from the server/local DB, rather than only rebuilding
session_index.jsonl.Temporary workaround
~/.codex/state_5.sqlite.Caution: this modifies the target conversation by adding a heartbeat message.
I am seeing a very similar Windows Codex Desktop project-sidebar failure, but with an additional deterministic path-rewrite signal that may help narrow the root cause.
Environment
C:\Program Files\WindowsApps\OpenAI.Codex_26.602.4764...%USERPROFILE%\.codex\state_5.sqlite,%USERPROFILE%\.codex\session_index.jsonl,%USERPROFILE%\.codex\.codex-global-state.jsonD:\...paths.User-visible behavior
Saved projects remain visible in the Desktop sidebar, but some project pages show no chats / incomplete history even though the corresponding local threads still exist on disk and in SQLite.
This is not data loss. The thread rows and rollout
.jsonlfiles are still present.Local diagnostics
Current sanitized counts from local read-only audit:
threadsrows in SQLite:339session_index.jsonl:171session_index.jsonl:16889cwd(\\?\...):167cwd:86The important part: the apparent problem is not simply that user chats are missing from
session_index.jsonl. Most active user-like chats are present in the index. The failure appears to be in project/root matching.Path matching evidence
Saved project roots in
.codex-global-state.jsonare stored in normal DOS path form, for example:But after Codex Desktop starts, many
threads.cwdvalues instate_5.sqliteare rewritten to Windows extended-length form:For active user-like threads in my local state:
threads.cwd== saved project root:0\\?\prefix:854So, if Desktop groups project conversations using string equality between
threads.cwdand saved roots, almost all project associations fail even though the paths are equivalent to Windows.Reproduction / experiment
A local repair script was used only after backing up state and with Codex Desktop closed. It normalized
threads.cwdfrom\\?\D:\...toD:\....Observed sequence:
This happened repeatedly. The repair changes were applied to disk, but Codex Desktop rewrote the
cwdvalues back to\\?\...during/soon after startup.I also tested adding
\\?\...versions of the roots to.codex-global-state.json(project-order/electron-saved-workspace-roots), but that made projects disappear from the sidebar entirely, so it does not appear to be a safe workaround.Expected behavior
Codex Desktop should treat these Windows paths as equivalent when grouping threads under projects:
Either:
threads.cwdin\\?\...form when project roots are stored in normal form, orA supported local reindex/rebuild command would also help, but the durable fix seems to be path canonicalization in Desktop project grouping.
Impact
The UI looks like chat history was deleted, but local data is still recoverable from SQLite/rollout files. This is high impact for users relying on Codex Desktop as project memory because saved projects become visually empty after restart/update.
Appears to be fixed.
Version 26.608.12217 • Released 9 Jun 2026
Adding a macOS datapoint after updating to the latest Desktop build.
Environment:
~/.codexRecovery status on my affected project:
state_5.sqlitestill has 251 active/non-archived rows with the expected project cwd.~/.codex/sessions.So my current result is: 26.608.12217 looks like a partial recovery, not a full recovery. It would still be very helpful to have an official full local reindex/recovery command that rebuilds sidebar/project history from durable local state.
Spent a few days investigating this on an affected install and wanted to share findings that might help others here. Your threads are not deleted. The conversation data stays intact in ~/.codex/state_5.sqlite (integrity check ok) and every thread still opens with codex resume <thread-id>. What changed is the sidebar/search behavior: it shows a bounded window of recently active threads, and older threads silently age out of view — which looks exactly like data loss. There is a one-command workaround. Giving a hidden thread one trivial turn of activity brings it back into the sidebar (and search), persistently across restarts: codex exec resume <thread-id> --skip-git-repo-check "reply with just OK" Notes from testing: editing local state files .codex-global-state.json, state_5.sqlite flags) does not restore listing, and any edits made while the app is running are overwritten on exit. In-session "restores" (asking the agent to fix the sidebar, fork-based restores) only appear to work and create duplicates. Documented the verified model with small recall/diagnostic scripts here: https://github.com/BulletCode-69/codex-thread-rescue (MIT). Hope it saves someone the panic I went through.
This appears to have changed with the latest release (at least on Windows).
All the chats from my old projects are back. Now, I notice that there is still a limit to how many chats remain in the sidebar for a single project. I have not counted them. But the one I am working on now, which has a lot of chats, only shows the last two weeks worth.
Thanks — that matches what I measured on macOS (latest build as well). The "only the last ~2 weeks show up" part seems to be the key mechanism rather than a glitch: the sidebar lists threads with recent activity, and everything older silently ages out, per project.
Two things from my testing that might be useful here:
On my install the old threads did not come back automatically with the update — possibly because my local display state had been through a partial migration. What reliably brings any specific thread back (persistently, until it ages out again) is giving it one trivial turn of activity: codex exec resume <thread-id> --skip-git-repo-check "reply with just OK"
The data is never gone — every "missing" thread is intact on disk and opens with codex resume <thread-id>, even when search can't find it.
So if anyone still has projects showing "No chats" after updating, it's worth checking with codex resume before assuming loss. Scripts/details: https://github.com/BulletCode-69/codex-thread-rescue
I believe I hit the same underlying issue and found an additional clue that may help narrow it down.
Symptoms
After updating Codex Desktop on Windows:
Importantly, the data was not lost.
Investigation
The SQLite database (
~/.codex/state_5.sqlite) still contained all threads.Historical threads had
cwdvalues like:However, after the update, newly created chats in the same project were being stored with:
This path does not exist on a normal Windows installation.
As a result:
Workaround
As a temporary workaround, I:
/mnt/<drive>/...thread paths insidestate_5.sqliteto match the new format.After doing this, nearly all project chats reappeared.
One Additional Detail
I had previously configured the agent environment to use WSL by default, and many of my historical threads were created in that environment.
Because of that, my database contained thread
cwdvalues like:I cannot say whether this issue affects users who have never enabled WSL or have a clean installation without WSL configured.
It is possible that this only occurs when migrating existing thread history between WSL-based workspace roots and the newer Desktop path handling. In my case, the issue appeared immediately after an update and only affected project chat visibility. The underlying session data remained intact.
I don't know if WSL is the root cause or merely a prerequisite for triggering the bug.
Possible Root Cause
This looks like a regression in workspace root normalization and matching between equivalent locations:
It may be helpful to canonicalize equivalent WSL and Windows paths before comparing workspace roots and to avoid persisting
C:\mnt\<drive>\...paths unless those mappings actually exist on the machine.Happy to provide additional diagnostics or database samples if needed.