Chat history under the original codex project disappears after connecting a third party - Codex
Quick fix
Upgrade to cc-switch v3.16.4 or newer, turn on "unified Codex session history" in settings, and migrate the official sessions.
Symptom
Section titled “Symptom”接入第三方,codex原来的项目下的聊天记录消失Chat history under the original codex project disappears after connecting a third party
The root cause is the session bucketing in the Codex CLI itself: official subscription sessions go in the openai bucket and third-party APIs in the custom bucket. Switching from the official subscription to a third-party API puts the sessions from the official account in a different "drawer", so they are invisible in the resume list. The chat history is not deleted — the JSONL files and the state database are still on disk.
For this, cc-switch added a "unified Codex session history" feature in v3.16.3, and in v3.16.4 extended the migration to support a state database relocated through CODEX_SQLITE_HOME, which resolves the problem.
Upgrade cc-switch to v3.16.4 or newer.
Open cc-switch and go to 设置 → Codex 应用增强 (Settings > Codex app enhancements).
Turn on the "unified Codex session history" switch.
In the dialog, tick "migrate existing official sessions" to merge the old sessions into the same history bucket. Your history is then visible again under the third-party provider.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 2 real issues
- Does upgrading cc-switch damage the Codex session/sqlite contents and lose all Codex chat history?
- No. This is a display effect of the Codex CLI bucketing session history by model_provider — the chat history is not deleted. Switch back to the official provider, or turn on unified session history, and it comes back.
- Without using the migration feature, is there another way to recover the original conversations?
- You can use 会话管理 (session management) at the top right of cc-switch to copy the resume command for a particular session, or pin the conversation in the desktop app so it stays visible.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.