Skip to content

Codex Desktop 26.519.22136: local project conversation history missing after update, threads still exist in state_5.sqlite #23979

@catink

Description

@catink

Summary

After updating Codex Desktop on macOS on May 22, 2026, multiple local project conversation histories disappeared from the Codex Desktop UI. The underlying local data still exists in ~/.codex, including state_5.sqlite, session_index.jsonl, and the original rollout JSONL files under sessions/ and archived_sessions/. The issue appears to be a UI/sidebar/project-history indexing or migration bug rather than data deletion.

Environment

  • Product: Codex Desktop App
  • Platform: macOS
  • Codex Desktop version observed in process metadata: 26.519.22136
  • Time of update/problem: May 22, 2026, Asia/Shanghai timezone
  • Local Codex directory: ~/.codex

User-Visible Impact

The following projects no longer show their expected conversation history in Codex Desktop:

  • /Users/<user>/Documents/code/project_244
  • /Users/<user>/Documents/code/project_466
  • Potentially also affected:
    • /Users/<user>/Documents/code/project_A
    • /Users/<user>/Documents/code/project_B
    • /Users/<user>/Documents/code/project_C

The conversations are important because they contain project-specific debugging, automation, data-processing, and research workflow context.

Evidence That Data Still Exists

Local database and rollout files still contain the missing threads.

state_5.sqlite

Query:

select id, cwd, title, archived, rollout_path
from threads
where cwd in (
  '/Users/<user>/Documents/code/project_244',
  '/Users/<user>/Documents/code/project_466'
)
order by updated_at desc;

Observed results include:

  • <thread_id_466_1>

    • cwd: /Users/<user>/Documents/code/project_466
    • archived: 0
    • rollout: ~/.codex/sessions/2026/03/19/rollout-2026-03-19T17-13-52-<thread_id_466_1>.jsonl
  • <thread_id_244_1>

    • cwd: /Users/<user>/Documents/code/project_244
    • archived: 0
    • rollout: ~/.codex/sessions/2026/04/01/rollout-2026-04-01T09-04-49-<thread_id_244_1>.jsonl
  • <thread_id_244_2>

    • cwd: /Users/<user>/Documents/code/project_244
    • archived: 0
    • rollout: ~/.codex/sessions/2026/03/27/rollout-2026-03-27T09-52-15-<thread_id_244_2>.jsonl
  • <thread_id_244_archived_1>

    • cwd: /Users/<user>/Documents/code/project_244
    • archived: 1
    • rollout: ~/.codex/archived_sessions/rollout-2026-04-01T09-03-55-<thread_id_244_archived_1>.jsonl

Counts

  • state_5.sqlite contains 153 threads.
  • The rollout JSONL files under sessions/ and archived_sessions/ also total 153 files.
  • session_index.jsonl had only 100 entries after update, which suggested an incomplete or stale index. Rebuilding it to 154 lines did not restore UI visibility.

Suspicious Migration/UI State Details

~/.codex/.codex-global-state.json contains:

  • electron-saved-workspace-roots including:
    • /Users/<user>/Documents/code/project_244
    • /Users/<user>/Documents/code/project_466
    • /Users/<user>/Documents/code/project_A
    • /Users/<user>/Documents/code/project_B

But project-order was truncated and only contained paths up to:

"/Users/<user>/Documents/code/project_244"

The following saved roots were missing from project-order after the update:

  • /Users/<user>/Documents/code/project_A
  • /Users/<user>/Documents/code/project_C
  • /Users/<user>/Documents/code/project_B
  • /Users/<user>/Documents/code/project_466

Manually adding them back did not restore visibility. Codex Desktop also appeared to rewrite .codex-global-state.json from an in-memory or separate persisted state on restart.

Attempted Workarounds

The following local recovery attempts were made after a full backup of ~/.codex:

  1. Backed up the full ~/.codex directory.
  2. Added missing saved workspace roots back into project-order.
  3. Rebuilt session_index.jsonl from state_5.sqlite.
  4. Added all non-archived threads to projectless-thread-ids.
  5. Temporarily locked .codex-global-state.json with macOS uchg to prevent overwrite during restart, then removed the lock.
  6. Investigated thread_source:
    • Newer visible-looking threads often had thread_source='user'.
    • Older missing project threads had thread_source set to NULL.
    • Updated 51 non-archived, non-automation old local threads from NULL to user.

None of these restored the missing conversations in the Codex Desktop UI.

Relevant Related Public Issues

These GitHub issues appear related:

Expected Behavior

Codex Desktop should display all non-archived local threads whose cwd points to saved workspace roots. For the affected projects, it should show at least:

  • 2 non-archived threads under /Users/<user>/Documents/code/project_244
  • 1 non-archived thread under /Users/<user>/Documents/code/project_466

Archived threads should remain visible through the archived/history view.

Actual Behavior

The affected project conversation histories are not visible in the Codex Desktop UI after the update, even though local SQLite rows and rollout JSONL files exist and remain readable.

Requested Help

Please advise how to repair or rebuild the Codex Desktop conversation sidebar/project-history index for existing local threads. If this is a known migration bug in Codex Desktop 26.519.22136, please provide:

  1. A supported recovery procedure.
  2. Whether state_5.sqlite, session_index.jsonl, .codex-global-state.json, or app-server state is authoritative for the Desktop UI.
  3. Whether there is a command to force a full local history reindex/backfill.
  4. Whether a fixed version is available or planned.

Attachments / Logs Available On Request

The user can provide:

  • A redacted copy of ~/.codex/state_5.sqlite
  • A redacted copy of ~/.codex/session_index.jsonl
  • Selected redacted rollout JSONL files for the affected thread IDs
  • ~/.codex/.codex-global-state.json
  • logs_2.sqlite excerpts

Please note that some files may contain private conversation content, local paths, and authentication-related metadata. Redaction guidance would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archiving

    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