← all repositories
Dailin521/codex-provider-sync

The Codex session detective: fixing missing chat history

When switching AI providers makes your old Codex conversations vanish, the data is usually still there—just metadata-out-of-sync.

codex-provider-sync
Velocity · 7d
+29
★ / day
Trend
accelerating
star history

What it does

This tool fixes a specific, annoying Codex bug: after you switch model_provider, previous sessions disappear from Desktop and /resume even though the actual conversation files still exist. It hunts through rollout files, SQLite state, and project path caches to sync the provider and visibility metadata so your history becomes browsable again.

The interesting bit

The README is admirably honest about what it won’t do. It refuses to manipulate updated_at timestamps to game Codex Desktop’s “recent 50” limit, and it won’t touch encrypted content that would break when opened under a different provider account. That’s unusual restraint for a utility tool—most would just brute-force the fix and let you discover the breakage later.

Key highlights

  • Targets four specific data locations: ~/.codex/sessions, ~/.codex/archived_sessions, ~/.codex/state_5.sqlite, and .codex-global-state.json
  • Offers both a Windows GUI (CodexProviderSync.exe) and a cross-platform CLI (codex-provider)
  • Auto-backs up before any sync or switch operation to ~/.codex/backups_state/provider-sync/
  • Includes diagnostic commands (status) that expose whether you’re hitting Codex Desktop’s hardcoded 50-session frontend limit
  • Handles locked files gracefully: skips active session rollouts, warns on malformed SQLite, stops rather than corrupts

Caveats

  • Requires Node.js 24+ for CLI; Node 20/22 users get a cryptic node:sqlite error
  • Windows-first: GUI is the recommended path, with CLI as fallback for macOS and others
  • Sessions with encrypted_content may reappear in lists but still fail to resume or compact under a different provider

Verdict

Worth a look if you’re a Codex power user juggling multiple providers and tired of your conversation history playing hide-and-seek. Skip it if you stay on one provider, use only the CLI /resume path, or expect full cross-provider conversation portability—the encryption boundaries are real and unfixable by metadata tweaks.

Frequently asked

What is Dailin521/codex-provider-sync?
When switching AI providers makes your old Codex conversations vanish, the data is usually still there—just metadata-out-of-sync.
Is codex-provider-sync open source?
Yes — Dailin521/codex-provider-sync is open source, released under the MIT license.
What language is codex-provider-sync written in?
Dailin521/codex-provider-sync is primarily written in C#.
How popular is codex-provider-sync?
Dailin521/codex-provider-sync has 2.8k stars on GitHub and is currently accelerating.
Where can I find codex-provider-sync?
Dailin521/codex-provider-sync is on GitHub at https://github.com/Dailin521/codex-provider-sync.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.