Conversation history disappears after switching Codex provider - CC Switch
Quick fix
After upgrading to v3.16.0 or above, CC Switch automatically migrates third-party provider history into the custom bucket; original files are backed up.
Symptom
Section titled “Symptom”切换后记录丢了Records are lost after switching.
Codex filters by model_provider to recover history, so switching between provider-specific ids makes past conversations appear to "disappear". All third-party providers are now merged into a single stable custom bucket (preserving reserved built-in ids such as openai / ollama), with a one-time device migration: rewriting historical JSONL sessions and the state_5.sqlite thread table, with original files backed up to ~/.cc-switch/backups/codex-history-provider-migration-v1/.
Upgrade CC Switch to v3.16.0 or higher. On first launch after upgrade, CC Switch automatically performs a one-time migration, merging all third-party provider history into the custom bucket.
If you need official subscription account and third-party sessions to interoperate, enable the "Unified Codex Conversation History" switch under Settings → Codex App Enhancements (added in v3.16.3); when enabled, you can opt to migrate existing official sessions.
For details on the mechanism and how to verify on disk, update to v3.16.4 and consult the in-app trilingual "Codex Unified Conversation History Guide".
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 2 real issues
- Where is the entry point for the one-time device migration?
- It runs automatically with no manual entry point. On first launch after upgrading to v3.16.0 or above, it runs once automatically, rewriting existing historical JSONL sessions and the state_5.sqlite thread table.
- How do official subscription account and third-party session histories interoperate?
- This is a separate switch: the "Unified Codex Conversation History" switch under Settings → Codex App Enhancements (added in v3.16.3) — when enabled, you can opt to migrate existing official sessions; when disabled, it restores precisely by ledger.
- Will my original history files be corrupted during migration?
- No. Before rewriting local JSONL sessions and the state database, an automatic backup is made. Original files are backed up under ~/.cc-switch/backups/codex-history-provider-migration-v1/ and can be rolled back precisely.
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.