You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Include archived Codex sessions in usage reports #1177
Make ccusage codex include archived Codex sessions by default when CODEX_HOME points to a Codex home.
Today the Rust adapter reads ~/.codex/sessions, but not ~/.codex/archived_sessions. I would like Codex home discovery to include both directories, while preserving the current behavior where a direct JSONL directory can still be used for saved codex exec --json output.
I opened an implementation PR at #1176, but it was auto-closed by the contributor gate.
Why?
Archived Codex sessions are still part of local usage history. Ignoring them makes token and cost reports look much lower than the real local history for users who archive conversations.
On my machine, the difference is large:
active sessions/: 18 JSONL files, about 289M total tokens
active + archived_sessions/: 51 JSONL files, about 1.66B total tokens
So the current default undercounts my Codex usage by excluding archived sessions.
How? (optional)
The implementation in #1176 does this in the Rust adapter:
Treat entries with sessions/ or archived_sessions/ as Codex homes.
Read both directories by default for Codex homes.
Keep direct JSONL directory behavior unchanged.
Deduplicate by relative JSONL path before parsing, with the active sessions/ copy winning over an archived copy.
Use the same discovery behavior in both the event loader and aggregate streaming path.
Validation from the PR branch:
cargo test --manifest-path rust/Cargo.toml --workspace codex -- --nocapture
This issue was auto-closed. Issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.
Keep the issue short, concrete, and written in your own voice.
If a maintainer replies lgtmi, your future issues will stay open. If a maintainer replies lgtm, your future issues and PRs will stay open.
Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.
Audit result: resolved. A later merged change or the current main implementation covers this request. This item is kept for history and does not need to be reopened.
Activity
github-actions commentedon May 28, 2026
This issue was auto-closed. Issues from new contributors are auto-closed by default.
Maintainers review auto-closed issues and reopen worthwhile ones. Issues that do not meet the quality bar in CONTRIBUTING.md may not be reopened or receive a reply.
Keep the issue short, concrete, and written in your own voice.
If a maintainer replies
lgtmi, your future issues will stay open. If a maintainer replieslgtm, your future issues and PRs will stay open.See CONTRIBUTING.md.
ryoppippi commentedon Aug 31, 2026
Historical audit: this discussion was auto-closed by the legacy contributor gate. That closure did not assess technical importance.
Audit result: resolved. A later merged change or the current
mainimplementation covers this request. This item is kept for history and does not need to be reopened.