Skip to content

Codex Desktop project sidebar shows No chats while local sessions still exist #22796

@AndresCanillas

Description

@AndresCanillas

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-pipelines
  • Installer_task
  • formaciones
  • scope 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.jsonl still contains the affected thread IDs and names.
  • Session .jsonl files still exist under .codex/sessions.
  • Some older sessions are intentionally under .codex/archived_sessions.
  • .codex-global-state.json contains many thread permissions with valid sandboxPolicy.writableRoots.
  • But top-level thread-workspace-root-hints contains 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: 20 threads
  • Explore and route: 13 threads
  • formaciones: 3 threads
  • 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-hints as a cache, not the source of truth.
  • If remote-project-connection-backfill-completed is 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_sessions to avoid reactivating archived threads.
  • Proposes missing thread-workspace-root-hints from heartbeat-thread-permissions-by-id.
  • Resolves Codex worktree roots back to canonical saved workspace roots when possible.
  • Only writes changes when executed with an explicit -Apply flag.
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions