codex - 💡(How to fix) Fix Windows app: older local threads disappear from sidebar and sidebar search after restart while still present on disk [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17540Fetched 2026-04-13 05:38:43
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2

Fix Action

Fix / Workaround

Repair attempts that did not fix it:

  1. Rebuilt session_index.jsonl
  2. Normalized threads.cwd in state_5.sqlite
  3. Patched workspace-root state
  4. Reset package-local cache
  5. Cleaned duplicated workspace roots
  6. Reinstalled Codex Desktop
RAW_BUFFERClick to expand / collapse

What version of the Codex App are you using (From “About Codex” dialog)?

26.409.20454

What subscription do you have?

ChatGPT Pro

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What issue are you seeing?

Older local Codex Desktop threads are no longer returned by the sidebar list or sidebar search after restart, even though they still exist in local state on disk.

Observed environment:

  • Codex About version: 26.409.20454
  • local diagnostics also show: app.version=0.119.0-alpha.28
  • Windows 11
  • timezone: Europe/Brussels
  • observed on 2026-04-12

What I see in the UI:

  • after a cold exit and relaunch, the sidebar only shows threads up to about 1w old
  • older threads are missing from the sidebar
  • switching the sidebar to Chronological does not restore them
  • searching for known missing thread ID 019cd29b-9215-7943-ae51-aa9c10dd74b4 returns no result

Why this looks like a local-state/indexing bug rather than data loss:

  • state_5.sqlite still contains 121 thread rows
  • session_index.jsonl still contains older March 2026 thread IDs
  • on-disk session rollout files still exist
  • the missing thread ID above is present locally but not returned by sidebar search

Strong path-normalization signal:

  • many threads.cwd values in state_5.sqlite are stored as \\?\C:\...
  • these can be normalized while Codex is closed
  • after reopening Codex, the app writes the \\?\-prefixed form back again

Relevant counts:

  • threads_total=121
  • first repair: cwd_prefixed_before=92
  • first repair: cwd_prefixed_after=0
  • after reopening Codex: prefixed threads.cwd rows returned to 92
  • first repair: index_lines_before=124
  • first repair: index_unique_before=118
  • first repair: index_duplicate_ids_before=5
  • first repair: index_lines_after=121

What steps can reproduce the bug?

  1. Fully exit Codex Desktop on Windows so no Codex process remains.
  2. Launch Codex Desktop again.
  3. Wait for the sidebar to load.
  4. Observe that only recent threads are visible; the oldest visible threads are about 1w old.
  5. Switch the sidebar to Chronological.
  6. Search for known missing thread ID 019cd29b-9215-7943-ae51-aa9c10dd74b4.
  7. Observe that the sidebar search returns no result.
  8. Inspect local state:
    • state_5.sqlite still contains older threads
    • session_index.jsonl still contains older thread IDs
    • older rollout session files still exist under %USERPROFILE%\.codex\sessions

Repair attempts that did not fix it:

  1. Rebuilt session_index.jsonl
  2. Normalized threads.cwd in state_5.sqlite
  3. Patched workspace-root state
  4. Reset package-local cache
  5. Cleaned duplicated workspace roots
  6. Reinstalled Codex Desktop

Result after all of the above:

  • older threads still do not appear in the sidebar
  • older threads still do not appear in sidebar search
  • after relaunch, prefixed threads.cwd values are regenerated

Representative local examples:

  • missing thread still present locally:
    • id=019cd29b-9215-7943-ae51-aa9c10dd74b4
    • created_at=2026-03-09 12:38:56 UTC
  • prefixed non-OneDrive example:
    • id=019cf6d0-b928-7231-a20f-c732d658d315
    • created_at=2026-03-16 13:23:19 UTC
    • cwd redacted=\\?\C:\dev\<project_redacted>
  • plain non-OneDrive example:
    • id=019d2479-db67-7173-b7a2-39918425f817
    • created_at=2026-03-25 10:10:59 UTC
    • cwd redacted=C:\dev\<project_redacted>

This does not appear to be OneDrive-only:

  • older missing threads include both OneDrive and non-OneDrive paths
  • they also include both \\?\C:\... and plain C:\... path forms

What is the expected behavior?

All local threads should remain visible and searchable in the Codex Desktop sidebar after restart.

Specifically:

  • restarting Codex should not hide older local threads
  • switching the sidebar to Chronological should still show those threads
  • sidebar search should return a locally existing thread ID or title
  • Codex should not regenerate path state in a way that breaks thread visibility

Additional information

Additional diagnostics:

  • logs_2.sqlite shows repeated thread/resume activity around launch/resume windows
  • no explicit log line was found saying “cwd rewritten”, but the before/after SQLite state shows that the prefixed cwd values are regenerated after app launch
  • local diagnostics include:
    • app_server.client_version="26.409.20454"
    • app.version=0.119.0-alpha.28

Artifacts available on request:

  • %USERPROFILE%\.codex\state_5.sqlite
  • %USERPROFILE%\.codex\session_index.jsonl
  • %USERPROFILE%\.codex\logs_2.sqlite
  • %USERPROFILE%\.codex\sessions
  • %USERPROFILE%\.codex\archived_sessions

I also have a redacted sidebar screenshot showing that the oldest visible items are labeled 1w, plus redacted exports of the thread state, session index, and launch-log summary.

<img width="1150" height="382" alt="Image" src="https://github.com/user-attachments/assets/3e73c6cc-3faf-4373-a82d-06d7124187d5" />

extent analysis

TL;DR

The issue with older local Codex Desktop threads not being returned by the sidebar list or search after restart may be related to the regeneration of prefixed cwd values in the state_5.sqlite database.

Guidance

  1. Verify database consistency: Check the state_5.sqlite database for any inconsistencies or corruption that might be causing the issue.
  2. Investigate path normalization: Look into the path normalization process and how it affects the cwd values in the database, as the regeneration of prefixed cwd values seems to be related to the issue.
  3. Check for indexing issues: Examine the session_index.jsonl file and the indexing process to ensure that all threads are being properly indexed and made available to the sidebar search.
  4. Test with a clean database: Try resetting the database or creating a new one to see if the issue persists, which can help determine if the problem is specific to the current database or a more general issue.
  5. Monitor log activity: Keep an eye on the logs_2.sqlite file for any error messages or unusual activity related to thread resume or path rewriting, which might provide clues about the cause of the issue.

Example

No specific code example is provided, as the issue seems to be related to the internal workings of the Codex Desktop application and its database.

Notes

The issue does not appear to be specific to OneDrive or any particular type of path, as both OneDrive and non-OneDrive paths are affected. The regeneration of prefixed cwd values after app launch seems to be a key factor in the issue.

Recommendation

Apply a workaround to prevent the regeneration of prefixed cwd values or to ensure that the database is properly updated after restart, as this seems to be the most likely cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING