Sessions flash then disappear after model_provider migration

Open 💬 2 comments Opened Jun 16, 2026 by jieshu666
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

## Symptoms
11 sessions flash briefly in the sidebar on startup, then disappear.
All data is confirmed intact in ~/.codex/sessions/, state_5.sqlite, and session_index.jsonl.

Logs show repeated errors:
state db missing rollout path for thread 019ea655...
state db discrepancy during find_thread_path_by_id_str_in_subdir: falling_back

## Verified (all correct)

  • JSONL files exist, valid, model_provider: "custom"
  • state_5.sqlite threads table has matching records
  • rollout_path is absolute, file exists on disk
  • session_index.jsonl entries present
  • Clearing ~/Library/Application Support/Codex and ~/Library/Caches/Codex + restarting does NOT fix

## Broken vs working session
Two sessions — structurally identical. One shown, one hidden:

| | Broken (019ecb90) | Working (019ecdba) |
|---|---|---|
| Lines | 150 | 107 |
| First line type | session_meta | session_meta |
| Last line type | event_msg | event_msg |
| All types | 4 same | 4 same |
| model_provider | custom | custom |
| File exists | ✅ | ✅ |
| stateDB record | ✅ | ✅ |

## Suspected cause
These sessions were migrated from model_provider: "openai" → "custom".
Codex may be performing an additional consistency check (backfill_state watermark, session hash, etc.) that fails for migrated sessions but passes for natively-created ones.

## Environment

  • Codex Desktop v0.140.0-alpha.2
  • macOS

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #26886
  • #27847
  • #28068
  • #27577
  • #27159

Powered by Codex Action

boombx403-byte · 9 days ago

Hi @jieshu666, your report looks related to a local session discovery/inventory gap rather than necessarily a lost rollout. I've released Codex Rescue Alpha5, a local read-only diagnostic tool that performs filesystem-first discovery across active and archived rollouts and cross-references SQLite/index metadata without modifying any state.

If you still have the affected local Codex directory, you can inspect it via:

pip install codex-rescue==0.1.0a5
codex-rescue sessions --json

No raw files or databases are needed. If you choose to share output, please review and sanitize any private repository paths or names first.