codex(session) usage statistics exceed my actual usage - Codex
Quick fix
Upgrade CC Switch to v3.19.2, then run “Rebuild Codex Usage” once on the “Usage Statistics” page.
Symptom
Section titled “Symptom”本次更新后的codex(session)很离谱,比我自己使用的量统计还多After this update, codex(session) is wildly inaccurate and reports more usage than I actually used.
The old Codex session log importer algorithm calculated deltas across multiple independent cumulative counters interleaved in the same rollout file, inflating usage statistics. This inflation bug was fixed in v3.19.2, but existing incorrect historical data is not repaired automatically.
Reports that relay models were also counted after routing was enabled may reflect the same issue. However, that issue timed out due to insufficient new reproduction details, with a recommendation to retry after the 4.0 refactor, so the available evidence does not confirm that both have exactly the same root cause. Whether Codex(Session) should count toward the total is a separate accounting-scope issue and is not covered by the v3.19.2 fix.
Upgrade CC Switch to v3.19.2 or a later version.
Open the “Usage Statistics” page and run “Rebuild Codex Usage” once to correct historical inflated data that is not repaired automatically.
If relay models are still counted repeatedly when routing is enabled on 4.0 or a later version, provide the CC Switch version, operating system, complete reproduction steps, and relevant logs or screenshots.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 2 real issues
- Why are the Codex(Session) statistics higher than actual usage?
- The old Codex session log importer incorrectly calculated deltas across independent cumulative counters interleaved in a rollout file, inflating usage.
- Will historical inflated data be corrected automatically after upgrading?
- No. After upgrading to v3.19.2, you must also run “Rebuild Codex Usage” once on the “Usage Statistics” page.
- Does Codex(Session) still count toward actual total usage?
- v3.19.2 only fixes inflated values. It does not change whether Codex(Session) is included in the total; that issue requires separate discussion.
- What should I do if relay models are still counted after enabling routing?
- The related report did not establish a distinct root cause. The maintainer recommended retrying on 4.0 or the latest version after the relevant refactor. If it persists, submit the version, operating system, complete reproduction steps, and logs or screenshots.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.