Conversation history is not saved

Open 💬 2 comments Opened Jul 5, 2026 by zyyxyd-crypto
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

1.2.31

What subscription do you have?

api

Which model were you using?

deepseek

What platform is your computer?

_No response_

What terminal emulator and version are you using (if applicable)?

_No response_

Codex doctor report

What issue are you seeing?

好的,以下是整理好的 Bug Report,可以直接复制粘贴:

---

Title: Threads disappear after app restart — state_5.sqlite threads table is empty (data loss)

Environment:

  • OS: Windows (Chinese locale)
  • Codex Desktop App
  • Date observed: 2026-07-05

Symptoms:

  1. When I restart the Codex desktop app, the thread list briefly appears in the sidebar for a split second, then flashes and disappears completely.
  2. All 18 previous threads are gone — only "New Chat" remains available.
  3. This persists across multiple restarts.

Root Cause (from local investigation):

  • %USERPROFILE%\.codex\sqlite\state_5.sqlite → threads table has 0 rows
  • %USERPROFILE%\.codex\sqlite\codex-dev.db → local_thread_catalog has only 2 rows (both workspace-local threads, not projectless ones)
  • %USERPROFILE%\.codex\backups_state\...\.codex-global-state.json → projectless-thread-ids still contains 18 thread IDs, confirming the threads existed before the wipe
  • The backup under backups_state\provider-sync\... was taken after the wipe — its state_5.sqlite also has 0 threads
  • Session rollout .jsonl files under sessions\ still exist on disk, but their rollout IDs don't map to thread IDs in the database

Hypothesis:
A database migration or sync operation wiped the threads table in state_5.sqlite, but the global state JSON (projectless-thread-ids) was not cleaned up in sync. This causes the UI to briefly render the stale thread list from the JSON index, then clear it when the actual database query returns empty.

Impact:
All thread history is locally unrecoverable. The session JSONL files contain raw conversation data but can't be reassociated with threads.

What steps can reproduce the bug?

重启应用就没有对话

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 1 month ago

English translation:

What version of Codex CLI is running?

1.2.31

What subscription do you have?

api

Which model were you using?

deepseek

What platform is your computer?

_No response_

What terminal emulator and version are you using (if applicable)?

_No response_

Codex doctor report

What issue are you seeing?

Okay, here is the organized bug report, ready to copy and paste:

---

Title: Threads disappear after app restart — state_5.sqlite threads table is empty (data loss)

Environment:

  • OS: Windows (Chinese locale)
  • Codex Desktop App
  • Date observed: 2026-07-05

Symptoms:

  1. When I restart the Codex desktop app, the thread list briefly appears in the sidebar for a split second, then flashes and disappears completely.
  2. All 18 previous threads are gone — only "New Chat" remains available.
  3. This persists across multiple restarts.

Root Cause (from local investigation):

  • %USERPROFILE%\.codex\sqlite\state_5.sqlite → threads table has 0 rows
  • %USERPROFILE%\.codex\sqlite\codex-dev.db → local_thread_catalog has only 2 rows (both workspace-local threads, not projectless ones)
  • %USERPROFILE%\.codex\backups_state\...\.codex-global-state.json → projectless-thread-ids still contains 18 thread IDs, confirming the threads existed before the wipe
  • The backup under backups_state\provider-sync\... was taken after the wipe — its state_5.sqlite also has 0 threads
  • Session rollout .jsonl files under sessions\ still exist on disk, but their rollout IDs don't map to thread IDs in the database

Hypothesis:
A database migration or sync operation wiped the threads table in state_5.sqlite, but the global state JSON (projectless-thread-ids) was not cleaned up in sync. This causes the UI to briefly render the stale thread list from the JSON index, then clear it when the actual database query returns empty.

Impact:
All thread history is locally unrecoverable. The session JSONL files contain raw conversation data but can't be reassociated with threads.

What steps can reproduce the bug?

Restart the app and the conversations are gone.

What is the expected behavior?

_No response_

Additional information

_No response_

<!-- codex-issue-translator -->

github-actions[bot] contributor · 1 month ago

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

  • #29868

Powered by Codex Action