Conversation history is not saved
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_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗