Skip to content

Select the latest Codex session by record timestamp, not file mtime #271

Description

@tsouth89

Problem

Codex “latest session” selection ranks rollout files by filesystem modification time. Restoring, copying, syncing, or touching an old rollout gives it a new mtime, so Ceiling can report an old session as the latest.

Claude and Grok already prefer the latest parsed record timestamp and use mtime only as a fallback.

Where

rust/src/cost_scanner.rs, in the Codex latest-session selection path.

Expected behavior

  • Rank Codex sessions by the maximum valid timestamp parsed from their records.
  • Use file mtime only when a session has no usable record timestamps.
  • Preserve deterministic tie-breaking.

Tests

Add a regression fixture where the older session has the newer mtime and verify the newer record timestamp wins. Add a fallback case with missing timestamps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersrustPull requests that update rust code

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions