Codex Desktop on Windows does not show existing local chat history after provider/auth config switches

Open 💬 3 comments Opened Jun 7, 2026 by LinX-Wang
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Title:
Codex Desktop on Windows does not show existing local chat history after provider/auth config switches

Summary

Codex Desktop on Windows does not show most existing chat history in the sidebar/project list, even though the local session files and state_5.sqlite records still exist.

This appears similar to other reports where sessions exist locally but are missing from the Desktop UI.

Environment

  • OS: Windows
  • Codex Desktop version: 26.602.40724
  • Codex home: D:\SOFTWARE\codex
  • Provider/auth setup:
  • Official OpenAI direct
  • local Sub2API
  • GMN relay
  • Switching is done by replacing:
  • config.toml
  • auth.json

What happened

After switching between provider/auth modes and reopening Codex Desktop, old chats from other modes do not appear in the sidebar/project list.

Switching back sometimes makes some history appear again, but the history is not consistently visible across modes.

What I checked

The underlying local data is still present:

  • D:\SOFTWARE\codex\sessions\... contains many rollout JSONL files.
  • D:\SOFTWARE\codex\state_5.sqlite contains the thread records.
  • D:\SOFTWARE\codex\session_index.jsonl can be rebuilt from state_5.sqlite.

Before manual repair, I observed:

  • threads.model_provider was split across openai, OpenAI, sub2api, and an older removed provider.
  • Real user threads had has_user_event = 0.
  • guardian/subagent threads were active and mixed into the same threads table.
  • Some active thread titles were extremely long, up to tens of thousands of characters.
  • session_index.jsonl only contained a small subset of the real user threads.

After manual repair, the data layer looked cleaner:

visible user threads: 40
active subagent threads: 0
session_index.jsonl user threads: 40
model_provider unified to current provider
cwd paths normalized from \\?\D:\... to D:\...
long active titles shortened

But Codex Desktop still does not reliably show all historical chats in the sidebar/project list.

Expected behavior

If local sessions and thread records exist, Codex Desktop should show all valid user threads, regardless of provider/auth config changes, or provide a safe built-in "repair/reindex local history" command.

Actual behavior

Only a small subset of historical chats appears in the sidebar/project list. Some projects show only one recent thread even when state_5.sqlite contains multiple user threads for that project.

Reproduction pattern

  1. Use Codex Desktop on Windows.
  2. Have multiple local chats across different projects.
  3. Switch provider/auth by replacing config.toml and auth.json.
  4. Reopen Codex Desktop.
  5. Observe that many old chats no longer appear, even though session JSONL files and SQLite records still exist.

Notes

Please do not treat this as data deletion. The data appears to remain on disk. The issue seems to be local history indexing/filtering in Codex Desktop.

Potential contributing fields:

  • threads.model_provider
  • threads.has_user_event
  • threads.thread_source
  • threads.source
  • threads.cwd
  • session_index.jsonl
  • active guardian/subagent threads
  • very long threads.title

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #25463
  • #25574
  • #26647
  • #26634
  • #26624

Powered by Codex Action

LinX-Wang · 2 months ago

Thanks. I reviewed the potential duplicates.

This may be related, but I am keeping this open because my case includes additional local-state details:

  • Windows Codex Desktop 26.602.40724
  • session files still exist under sessions/
  • state_5.sqlite still contains user threads
  • all real user threads had has_user_event = 0
  • active guardian/subagent threads were mixed into the thread table
  • some active thread titles were extremely long
  • session_index.jsonl only contained a subset of real user threads
  • the issue became visible after switching provider/auth configs

If one of the listed issues is the canonical tracker, feel free to close/merge this one.

boombx403-byte · 9 days ago

Hi @LinX-Wang, your report looks related to a local session discovery/inventory gap rather than necessarily a lost rollout. I've released Codex Rescue Alpha5, a local read-only diagnostic tool that performs filesystem-first discovery across active and archived rollouts and cross-references SQLite/index metadata without modifying any state.

If you still have the affected local Codex directory, you can inspect it via:

pip install codex-rescue==0.1.0a5
codex-rescue sessions --json

No raw files or databases are needed. If you choose to share output, please review and sanitize any private repository paths or names first.