Skip to content

Codex Desktop Profile token usage does not increase despite local token growth and analytics diagnostics #31010

Description

@jackiemingnew

What version of Codex are you using?

  • Codex Desktop: 26.623.101652 (CFBundleVersion 4674)
  • Bundled/linked CLI: codex-cli 0.142.5
  • Platform: macOS 26.5.1 (25F80), Apple Silicon arm64
  • Subscription: Pro

What issue are you seeing?

The Codex Desktop Profile page token activity / daily usage bucket does not reliably increase even though local Codex token totals are increasing.

This appears similar to #25479, where local ~/.codex/state_*.sqlite token totals diverge from the Profile API / UI buckets. I am opening a separate issue because I collected a short-window diagnostic that compares:

  1. local token growth,
  2. analytics upload signals,
  3. remote Profile bucket growth,
  4. queue-drop signals,
  5. network probe signals.

Observed behavior

During a 30-minute observation window:

  • Observation window: 2026-07-03 16:54:31 to 2026-07-03 17:24:31 local time
  • Local token total increased from 351,318,464 to 357,178,221
  • Local delta: 5,859,757 tokens
  • Remote Profile todays bucket stayed at 940,450
  • Remote Profile delta: 0 tokens
  • Gap: 5,859,757 tokens
  • Analytics POST 200 observed in that exact 30-minute window: 0
  • Analytics error count observed in that exact 30-minute window: 0
  • Analytics queue drops observed: 0
  • Profile fetch errors observed: 2
  • Network probe status: LOCAL_NETWORK_SUSPECT
  • Network probes: 16 / 24 failed at DNS/TCP/TLS/HTTP reachability checks

A later short local check did observe an analytics POST 200 and still showed no queue drops, so the upload path is not completely dead. However, Profile daily usage still appears to lag or miss local token growth.

Expected behavior

If Codex records local token usage for completed turns, the Profile token activity / daily usage bucket should eventually reflect that usage, or the UI/API should document the accounting differences clearly.

In particular, it should be clear whether the Profile page:

  • excludes some local sessions,
  • excludes archived sessions,
  • excludes subagent/main-agent usage differently,
  • samples or delays usage,
  • depends on analytics upload events,
  • can miss token fields when turn events are emitted before token usage facts arrive.

Diagnostic notes

From the open-source Codex code path, the analytics flow appears to be turn-based:

  • Core records TurnTokenUsageFact for a turn.
  • The analytics reducer combines turn facts and emits codex_turn_event.
  • The analytics client queues events and POSTs them to /codex/analytics-events/events.
  • The queue size appears bounded, and queue is full would be logged if events were dropped.

One important detail: token fields in the codex_turn_event appear optional. If a turn event is emitted before token_usage is attached, it may be possible for a turn event to be uploaded without total_tokens. I have not confirmed this is happening, but it is a plausible area to inspect given the local-vs-remote gap.

Related public reports

Privacy / safety

No auth token, cookie, Authorization header, full account ID, or raw POST body is included here. The numbers above are aggregated local/remote token totals and status-level diagnostics only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingconnectivityIssues involving networking or endpoint connectivity problems (disconnections)rate-limitsIssues related to rate limits, quotas, and token usage reporting

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions