Repository navigation
Usage dashboard gradually loses token history from previous days #1580
Description
Client or integration
OpenCodex dashboard
Area
Dashboard
Summary
The Usage dashboard loses token usage from yesterday and earlier dates as time passes.
I expected token totals for a completed day to remain stable. Instead, after leaving the automatically started background service running and refreshing the Usage page later, the token total for yesterday decreased even though no restart, upgrade, cleanup, or configuration change occurred during the observation.
Reproduction
- Upgrade OpenCodex with
ocx updateto version 2.12.0. - Let the updater refresh and automatically start the background service on port 10100. No additional service arguments are used.
- Keep the service running. Do not restart OpenCodex, run another upgrade, clear storage, or change configuration.
- Open
http://localhost:10100/#usage. - Select All providers and the 7 days range.
- Record the token usage for yesterday. In the first screenshot, 08-12 shows 19.1亿 tokens.
- Leave the service running and refresh the same Usage page later.
- Observe that the completed day's value has decreased. In the newer screenshot, 08-12 shows 18.9亿 tokens.
At the same time, the current day's usage increased from 20.6亿 to 20.7亿, so new requests were still being recorded. The failure is that older usage is gradually removed from the historical total.
This is time-dependent and can be observed by taking two snapshots of the same 7-day view at different times; no other user action is required between snapshots.
Version
2.12.0
Operating system
macOS 15.7.7 on Apple M1
Provider and model
All providers and models shown by the dashboard; the issue does not appear provider-specific.
Logs or error output
No visible error is shown on the Usage page. The service remains running on port 10100.Screenshots and supporting files
Both screenshots show the 08-12 token total in the same 7-day view and were captured at different times on 2026-08-13.
| Earlier capture — 08-12: 19.1亿 tokens | Later capture — 08-12: 18.9亿 tokens |
|---|---|
![]() |
![]() |
Comparison: the 08-12 historical total decreased by 0.2亿 tokens (19.1亿 → 18.9亿), while 08-13 increased from 20.6亿 to 20.7亿.
Redacted configuration
{}Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.


Activity
github-actions commentedon Aug 13, 2026
Issue reopened
The report now contains the information required by the automated check. Thanks for updating it.
folochina commentedon Aug 13, 2026
不用做任何操作,就是在用量界面查看统计,然后隔一段时间刷新,会发现昨天的 token 使用量统计再变少
[-]我的统计里面 token 只有最近24 小时还是怎么来着,久一点的数据会随时间丢失[/-][+]Usage dashboard gradually loses token history from previous days[/+]test(usage): extend calendar-boundary regression test to cover 30d ra…
lidge-jun commentedon Aug 14, 2026
Fixed by cherry-picking #1638 (fix(usage): align 7d and 30d range windows to start-of-day calendar boundaries) onto dev at 2d888de6d.
fix(usage): align 7d and 30d range windows to start-of-day calendar b…
test(usage): extend calendar-boundary regression test to cover 30d ra…
docs(devlog): plan the usage lifecycle and memory-defense roadmap
fix(usage): align 7d and 30d range windows to start-of-day calendar b…
test(usage): extend calendar-boundary regression test to cover 30d ra…
docs(devlog): plan the usage lifecycle and memory-defense roadmap