Skip to content

Usage dashboard gradually loses token history from previous days #1580

Description

@folochina

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

  1. Upgrade OpenCodex with ocx update to version 2.12.0.
  2. Let the updater refresh and automatically start the background service on port 10100. No additional service arguments are used.
  3. Keep the service running. Do not restart OpenCodex, run another upgrade, clear storage, or change configuration.
  4. Open http://localhost:10100/#usage.
  5. Select All providers and the 7 days range.
  6. Record the token usage for yesterday. In the first screenshot, 08-12 shows 19.1亿 tokens.
  7. Leave the service running and refresh the same Usage page later.
  8. 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
Earlier capture: 08-12 shows 19.1亿 tokens Later capture: 08-12 shows 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliCLI, config inject, packaging flagsguiDashboard, tray, settings UI

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions