I ran into an annoying Codex problem while switching between official OpenAI auth and relay/custom providers.
The sessions were not actually gone. What broke was session visibility.
In practice, the symptoms looked like this:
- old sessions were visible under one provider, then disappeared after switching to another one
-
codex resumeand Codex App did not always show the same history - changing only the rollout files was not enough
Why this happens
Codex stores provider-related session metadata in two places:
- rollout files under
~/.codex/sessionsand~/.codex/archived_sessions - SQLite state in
~/.codex/state_5.sqlite
If only one layer is updated, the history may still look inconsistent. That is why a session can appear to be "missing" even though the actual data is still there.
What I built
I built codex-provider-sync to align both layers together.
It can:
- inspect the current provider distribution
- sync rollout metadata and SQLite state to a target provider
- optionally update root
model_providerinconfig.toml - create a backup before each run
- restore from backup if needed
- skip locked live rollout files and report them clearly
Windows GUI
I also added a Windows GUI so normal users do not need Node or npm anymore.
The GUI can:
- scan the current
.codexhome - show provider distribution from rollout files and SQLite
- let you pick a target provider and execute the sync
- optionally update root
model_provider - restore from backup
- automatically keep the newest 5 managed backups by default, with configurable retention
Links
- GitHub: https://github.com/Dailin521/codex-provider-sync
- Release: https://github.com/Dailin521/codex-provider-sync/releases/tag/0.2.0
If you have hit the "my Codex history disappeared after switching providers" problem, this is exactly what the tool is meant to fix.
Top comments (0)