Sessions flash then disappear after model_provider migration

Open 💬 1 comment Opened Jun 16, 2026 by jieshu666

## 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 ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗