cc-switch Codex session history missing
Quick fix
Disable Codex routing or unified history in cc-switch, make model_provider match old sessions, then restart Codex to restore history.
Symptom
Section titled “Symptom”就是自从使用了这个 cc-switch,导致我的 Codex 里面的会话全部都看不见了。虽然会话文件还在,但是没有记录了。After using cc-switch, all sessions in Codex became invisible. The session files still exist, but no records are shown.
Codex filters the session history list by the current model_provider exactly. Enabling cc-switch Codex routing/official proxy writes model_provider = "cc-switch-official"; disabling routing or using a custom provider may use model_provider = "custom". If existing sessions under ~/.codex/sessions have a different provider in session_meta, the list appears empty even though the session files still exist.
The issue describes this as a compatibility/product defect in the v3.17.0 official proxy implementation with “unified history using custom”; users reported it was still unfixed in v3.18.0. Some comments say disabling the related switch restores sessions, while others say it does not, indicating provider naming may differ by environment. Verify that model_provider in the current Codex config matches the session files.
Disable the Codex routing/proxy switch in cc-switch (one user screenshot confirmed sessions returned after disabling it).
Restart Codex and check whether the session history is restored.
If not restored, compare model_provider in the current Codex config with model_provider in session_meta for the affected sessions under ~/.codex/sessions.
~/.codex/sessions 下会话文件中的 session_meta 示例 {"model_provider": "cc-switch-official"}If they differ, batch-edit the old sessions' model_provider to the provider currently in use, or change the current config to match the old sessions. You can also have Codex write a repair script and delete extra history backups generated by CC Switch.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 1 real issues
- The session files still exist but Codex does not show them. Are they really lost?
- Usually not. The issue confirms ~/.codex/sessions files remain, but Codex filters history by model_provider. If the provider does not match, the list appears empty.
- Which switch should be disabled to restore sessions?
- One user confirmed that disabling the Codex routing/proxy switch in cc-switch restored sessions. Another user said disabling it did not help, so verify that model_provider matches.
- Why does enabling or disabling routing switch between two sets of history?
- When routing is enabled, model_provider = "cc-switch-official". When routing is disabled, model_provider = "custom". The two session sets belong to different providers, so history appears to disappear or switch.
- Was this fixed in v3.18.0?
- Users in the issue reported that it existed in v3.17.0 and remained unfixed after updating to v3.18.0.
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.