Skip to content

Codex usage disappears after archiving a session #662

Description

@gt-zhangshihao03

Problem

CodeBurn only discovers Codex session files under ~/.codex/sessions/YYYY/MM/DD. When a conversation is archived, Codex moves its rollout file to the flat ~/.codex/archived_sessions directory. The next CodeBurn refresh no longer discovers that file, so its historical token usage disappears from reports.

Reproduction

  1. Run codeburn report --provider codex and note the usage total.
  2. Archive a Codex conversation.
  3. Refresh the report.
  4. Usage from the archived conversation is missing, although its JSONL file still exists under ~/.codex/archived_sessions.

Observed with CodeBurn 0.9.15 and current Codex Desktop storage.

Proposed fix

Discover valid rollout-*.jsonl files from both the date-partitioned active sessions directory and the flat archived sessions directory, using the same metadata validation and project attribution for both. Add a regression test for an archived-only Codex home.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions