Skip to content

codex doctor reports valid legacy rollout files as scan errors #26877

Open

Description

@gheorgheiuga

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, directory codex-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 doctor recognizes this legacy rollout format and does not report it as a bad file.
  • codex doctor reports 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:

  1. Legacy rollout support in doctor/backfill.
  2. A documented migration command.
  3. A clearer diagnostic such as legacy rollout format not indexed.
  4. A supported way to archive/ignore legacy rollouts without doctor warnings.

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on Jun 7, 2026
  2. self-assigned this
    on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

CLIIssues related to the Codex CLIbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archiving

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions