Codex usage statistics abnormally high or stopped updating
Quick fix
Identify the problem type and upgrade to the corresponding fix version; fork double counting was fixed in v3.18.0, Windows file growth missed syncing in…
Symptom
Section titled “Symptom”Codex 正常运行,但 CC Switch 的 Codex 统计用量停止更新。Codex runs normally, but CC Switch's Codex usage statistics stop updating.
These issues cover several different Codex usage problems, not a single fault: fork sessions may double-count the parent session history; cumulative token snapshots may overestimate usage when they regress, replay, or interleave across rate_limits.limit_id; on Windows, a rollout file can grow while its mtime stays unchanged, causing missed syncing; two-segment filenames of resumed sessions can cause a file to be deferred indefinitely; a fork after the parent session ends may also wait forever. There are also separate problems such as dashboard summary cards not refreshing, inconsistent quota calculations, and switching to the API when account quota is exhausted, which cannot be covered by one fix. The issues explicitly confirm that the fork double-counting fix shipped with v3.18.0 and the Windows file growth missed-syncing fix shipped with v3.20.3; for the other problems, the material has no unified conclusion about a released fix.
First check the specific symptoms in the CC Switch logs: if usage jumps sharply right after a fork, confirm the version is v3.18.0 or higher; if on Windows the file keeps growing but statistics stall, upgrade to v3.20.3 or higher.
If after resuming a session the logs repeatedly show “文件名线程 ID ... 与 root meta ID ... 不一致”, or a fork session stays deferred, keep the relevant logs and retest on the latest version; provide the version number and the corresponding scenario, as the issue gives no directly executable user-side fix steps.
If Codex detail records are stored but the dashboard summary card does not update, or the official account quota display is inconsistent, retest on the latest version; record the card numbers, database comparison, screenshots, and version number to help locate the problem.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 8 real issues
- #2571Codex fork 会话会重复统计父会话历史 token,导致用量面板明显偏高
- #2638Codex官方账户额度统计不一致
- #3011Codex 单个 session 用量被严重高估:total_token_usage 非单调/重放时被当作新增 delta 统计
- #4852codex登陆的个人账号没有额度之后,开启不退出切api功能,无法正常使用api。关闭后正常。
- #6904Codex 用量统计在恢复(resume)会话后静默停止:双段文件名 rollout 被判「文件名线程 ID 与 root meta ID 不一致」永久 deferred(v3.20.0 / Windows)
- #7135[Bug] codex 会话用量增量同步正常入库,但仪表盘"真实消耗 Tokens"汇总卡不刷新,仅手动重建后更新
- #7264Codex用量漏统计,活动日志增长但修改时间不变时被跳过同步
- #7344Codex用量漏统计:父会话结束或关闭后,分叉会话仍被延迟同步
- After upgrading, fork sessions still count parent session history into usage. What should I do?
- The issue states the fix for this problem shipped with v3.18.0; if it still reproduces on a higher version, report it again with the version and reproduction details.
- On Windows the Codex log has new content, but usage no longer grows. What should I do?
- v3.20.2 users may still be affected by the unchanged mtime; the issue confirms the fix shipped with v3.20.3.
- After resuming a session, usage statistics stop and the log shows the filename thread ID mismatching the root meta ID. What should I do?
- That issue records the cause of the persistent deferral but gives no released fix version; retest on the latest version and report the logs, version, and resumed-session scenario.
- The dashboard summary card does not refresh, but incremental details are already stored. What should I do?
- The issue suggests retesting on the latest version; if it persists, provide the version number, the summary card numbers, and the direct database query results.
- Why are the usage statistics inconsistent with the official account quota?
- The issue explains that 4.0 reworked the quota and usage display, and the two may use different calculation methods; verify on the latest version and provide the specific page, values, screenshots, and version.
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.