Skip to content

Include archived Codex sessions in usage reports - #663

Closed
gt-zhangshihao03 wants to merge 1 commit into
getagentseal:mainfrom
gt-zhangshihao03:fix/codex-archived-sessions
Closed

Include archived Codex sessions in usage reports#663
gt-zhangshihao03 wants to merge 1 commit into
getagentseal:mainfrom
gt-zhangshihao03:fix/codex-archived-sessions

Conversation

@gt-zhangshihao03

Copy link
Copy Markdown
Contributor

Summary

  • scan Codex archived_sessions alongside date-partitioned active sessions
  • share validation and project attribution between active and archived rollout files
  • add an archived-only regression test and document both storage paths

Fixes #662

Testing

  • npm test -- --run tests/providers/codex.test.ts (22 passed)
  • npx tsc --noEmit
  • npm test -- --run (1674 passed; one unrelated cli-status-menubar test exceeded its 5s timeout under parallel load)
  • reran the timed-out test in isolation: passed in 3.03s

@ozymandiashh

Copy link
Copy Markdown
Collaborator

Thanks for this, @gt-zhangshihao03 — clean fix and the right approach.

It had picked up a merge conflict with main after #656 landed, so I rebased it onto current main (resolving a small README provider-table conflict) and opened #667, which supersedes this PR. Your commit authorship is preserved on the rebased branch.

On review we confirmed there's no double-counting if a session were ever present in both sessions/ and archived_sessions/ (parsing dedups on a content-based key shared across all sources), and that the new regression test genuinely covers the archived-only home (fresh temp dir with only archived_sessions/, so it exercises the readdir(sessionsDir).catch(() => []) fall-through). We'll merge from #667.

@iamtoruk

Copy link
Copy Markdown
Member

Thanks for finding and fixing this. Your fix shipped in #667, which was a rebase of this branch onto current main with identical hunks, and is now merged. Archived Codex sessions are counted as of the next release. Closing this one as superseded, the credit for the catch is yours.

@iamtoruk iamtoruk closed this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex usage disappears after archiving a session

3 participants