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:
- When I restart the Codex desktop app, the thread list briefly appears in the sidebar for a split second, then flashes and disappears completely.
- All 18 previous threads are gone — only "New Chat" remains available.
- This persists across multiple restarts.
Root Cause (from local investigation):
%USERPROFILE%\.codex\sqlite\state_5.sqlite→threadstable has 0 rows%USERPROFILE%\.codex\sqlite\codex-dev.db→local_thread_cataloghas only 2 rows (both workspace-local threads, not projectless ones)%USERPROFILE%\.codex\backups_state\...\.codex-global-state.json→projectless-thread-idsstill contains 18 thread IDs, confirming the threads existed before the wipe- The backup under
backups_state\provider-sync\...was taken after the wipe — itsstate_5.sqlitealso has 0 threads - Session rollout
.jsonlfiles undersessions\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_
2 Comments
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.sqlitethreads table is empty (data loss)Environment:
Symptoms:
Root Cause (from local investigation):
%USERPROFILE%\.codex\sqlite\state_5.sqlite→threadstable has 0 rows%USERPROFILE%\.codex\sqlite\codex-dev.db→local_thread_cataloghas only 2 rows (both workspace-local threads, not projectless ones)%USERPROFILE%\.codex\backups_state\...\.codex-global-state.json→projectless-thread-idsstill contains 18 thread IDs, confirming the threads existed before the wipebackups_state\provider-sync\...was taken after the wipe — itsstate_5.sqlitealso has 0 threads.jsonlfiles undersessions\still exist on disk, but their rollout IDs don't map to thread IDs in the databaseHypothesis:
A database migration or sync operation wiped the
threadstable instate_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 -->
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action