codex doctor reports valid legacy rollout files as scan errors
Bug: codex doctor reports legacy 2025 rollout files as scan errors
Summary
codex doctor --all reports rollout scan was incomplete or found bad files for older Codex rollout JSONL files that appear to be valid legacy CLI-era conversations, but use a pre-session_meta / response_item format.
The current thread inventory is otherwise clean: active rollout files and DB rows match, archived rows match, there are no duplicate thread IDs, and all SQLite integrity checks pass.
Environment
- Codex version:
0.137.0 - Platform:
macos-aarch64 - Install method: npm package
@openai/codex - Repository metadata from installed package:
git+https://github.com/openai/codex.git, directorycodex-cli - Auth mode: ChatGPT auth
- Network/WebSocket/reachability: OK when run outside the local sandbox
Current Doctor Result
After quarantining unrelated context-only stubs and archived duplicates, codex doctor --all still reports:
⚠ threads rollout scan was incomplete or found bad files
rollout DB active files 152
rollout DB active rows 152
rollout DB archived files 0
rollout DB archived rows 0
rollout DB missing active rows 0
rollout DB missing archived rows 0
rollout DB duplicate rollout thread ids 0
rollout DB duplicate DB paths 0
rollout DB scan errors 23
rollout DB malformed file names 0
rollout DB scan cap reached false
State DB health is OK:
state DB integrity ok
log DB integrity ok
goals DB integrity ok
memories DB integrity ok
Example Legacy File Shape
The scan-error files are under ~/.codex/sessions/2025/.../rollout-*.jsonl.
They start like this:
{"id":"<uuid>","timestamp":"2025-08-13T15:22:56.917Z","instructions":null}
{"record_type":"state"}
{"type":"message","id":null,"role":"user","content":[{"type":"input_text","text":"<user prompt>"}]}
{"record_type":"state"}
{"record_type":"state"}
Later records may include old-style top-level records such as:
{"type":"reasoning", ...}
{"type":"message", "role":"assistant", ...}
{"type":"function_call", ...}
These are not empty files and appear to be historical Codex CLI conversations. Newer indexed files use:
{"timestamp":"...","type":"session_meta","payload":{...}}
{"timestamp":"...","type":"response_item","payload":{...}}
Expected Behavior
One of:
codex doctorrecognizes this legacy rollout format and does not report it as a bad file.codex doctorreports a clearer legacy-format note instead of a warning.- Codex provides an official migration/backfill command for legacy rollout files.
- Codex ignores legacy rollout files if they are intentionally unsupported by the current thread index.
Actual Behavior
codex doctor reports the legacy files as scan errors:
rollout DB scan error sample ~/.codex/sessions/2025/...jsonl (no parseable rollout items)
This makes the installation remain degraded even though:
- thread DB parity is otherwise clean
- active files equal active rows
- archived missing rows are zero
- duplicate thread IDs are zero
- database integrity checks pass
Why This Matters
These files appear to be historical Codex CLI conversations. Manual conversion would require rewriting JSONL record structure and inserting rows into state_5.sqlite, which is risky without an official schema/migration path.
The current doctor output suggests corruption or bad files, but the files may simply be valid legacy rollouts.
Requested Fix
Please clarify and ideally implement one of:
- Legacy rollout support in doctor/backfill.
- A documented migration command.
- A clearer diagnostic such as
legacy rollout format not indexed. - A supported way to archive/ignore legacy rollouts without doctor warnings.