codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex Desktop macOS Profile Usage Statistics Not Updating

Open ryxncodes opened this issue 6 months ago • 8 comments

What version of the Codex App are you using (From “About Codex” dialog)?

26.527.31326

What subscription do you have?

Plus

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

Codex Desktop Profile usage stats appear stale or incomplete after the 26.527 app update.

The Profile page shows usage stats, but they do not match recent local Codex usage recorded by the app. I have been actively using Codex for several days, and local usage is being recorded, but the Profile/token activity page shows very little recent activity.

Current Profile page values:

  • Lifetime tokens: 340.5M
  • Peak tokens: 71.8M
  • Longest task: 23m 30s
  • Current streak: 6 days
  • Longest streak: 14 days

Local Codex data shows recent usage exists:

Local ~/.codex/state_5.sqlite threads:
17 threads
190,694,514 total local tokens
first thread: 2026-05-25 21:43:40
latest update: 2026-05-31 21:59:44

Recent local daily totals: 2026-05-31: 3 threads, 46,111,470 tokens 2026-05-30: 4 threads, 55,470,571 tokens 2026-05-29: 4 threads, 10,503,735 tokens 2026-05-28: 1 thread, 20,226,034 tokens 2026-05-27: 3 threads, 30,038,778 tokens 2026-05-26: 1 thread, 27,852,511 tokens 2026-05-25: 1 thread, 491,415 tokens

A read-only check of the profile stats endpoint returns values matching the stale UI:

{
  "lifetime_tokens": 340531022,
  "peak_daily_tokens": 71760229,
  "longest_running_turn_sec": 1410,
  "current_streak_days": 6,
  "longest_streak_days": 14,
  "bucket_count": 25,
  "last_buckets": [
    { "start_date": "2026-05-25", "tokens": 1157015 },
    { "start_date": "2026-05-26", "tokens": 29070753 },
    { "start_date": "2026-05-27", "tokens": 36061356 },
    { "start_date": "2026-05-28", "tokens": 22154643 },
    { "start_date": "2026-05-29", "tokens": 12789459 },
    { "start_date": "2026-05-30", "tokens": 76450 }
  ]
}

The mismatch is especially visible on 2026-05-30: Local Codex recorded: 55,470,571 tokens Profile API bucket: 76,450 tokens The profile API also does not show a 2026-05-31 bucket yet, despite active usage on that date.

What steps can reproduce the bug?

1. Update/open Codex Desktop 26.527.31326 on macOS.
2. Sign in with a ChatGPT Plus account.
3. Use Codex actively across several local threads.
4. Open Settings → Profile.
5. Observe that lifetime stats and token activity do not reflect recent local usage.
6. Compare the Profile page with local Codex thread usage recorded in `~/.codex/state_5.sqlite`.
7. Optionally compare with the profile stats response from `/backend-api/wham/profiles/me`.

The UI appears to match the stale server response, so this does not look like only a local UI rendering issue.

Image

What is the expected behavior?

The Codex Profile page should update token activity and usage stats based on recent Codex usage, or clearly explain if these stats are delayed, sampled, exclude certain local sessions, or use a different accounting method than local recorded thread token totals.

Additional information

No response

ryxncodes avatar Jun 01 '26 02:06 ryxncodes

I hit what looks like a related freshness issue in Codex Desktop: the menu bar / Settings → Usage values can lag behind the ChatGPT Codex usage page in Chrome.

I looked through current main in the public repo and found a few details that may help narrow this down:

  • Rate limits and profile token activity are separate app-server paths. account/rateLimits/read fetches rate-limit/credit state through BackendClient::get_rate_limits_many(), which maps to /wham/usage for normal ChatGPT backend URLs and /api/codex/usage for Codex API-style URLs.
  • account/usage/read fetches the profile/token activity summary through BackendClient::get_token_usage_profile(), which maps to /wham/profiles/me for normal ChatGPT backend URLs.
  • I do not see an account/usage/updated notification in the app-server protocol.
  • account/rateLimits/updated appears sparse/event-driven: app-server emits it while handling TokenCountEvent when rate_limits is present. Core can retain/re-emit the latest snapshot and error/compaction paths can update it, so I would not treat the notification as proof that the client has just fetched a fresh account snapshot.

My current hypothesis is that there may be two related freshness problems:

  1. For the menu bar / Settings → Usage case, the desktop UI likely needs to refetch visible account usage/rate-limit state on open/focus/turn completion, or poll slowly while the usage UI is visible, rather than relying only on cached state or sparse notifications.
  2. For the Profile stats mismatch described in this issue, if /wham/profiles/me itself returns stale values, a renderer refetch alone will not fix it; that probably needs backend/accounting investigation or the desktop Profile page may need to use the same source as the Chrome dashboard.

The repo contribution guide says unsolicited PRs are not accepted, so I’m sharing the analysis here first. Would maintainers be open to a targeted PR around app-server docs / public refresh behavior, or is the intended fix in the desktop renderer/backend?

SloanBDavis avatar Jun 07 '26 01:06 SloanBDavis

This is happening for me too.

christopheragnus avatar Jun 17 '26 04:06 christopheragnus

I am seeing a similar mismatch in Codex Desktop Profile usage stats.

Environment:

  • Platform: macOS, arm64
  • Timezone: Asia/Shanghai
  • App language/UI: Chinese
  • Codex Desktop version: not captured in the screenshots; I can provide it from About Codex if needed.

Observed on Jun 17, 2026:

  • Profile -> Token activity daily heatmap shows recent days as 0 tokens:
    • Jun 16: 0 tokens
    • Jun 17: 0 tokens
  • However, the Usage Limits panel clearly shows usage has been consumed:
    • General 5-hour usage limit: 94% remaining
    • General weekly usage limit: 45% remaining
    • GPT-5.3-Codex-Spark 5-hour usage limit: 94% remaining
    • GPT-5.3-Codex-Spark weekly usage limit: 69% remaining

Expected: Token activity should either reflect recent Codex usage, or the UI should clearly explain that Token activity and Usage Limits use different accounting sources / update schedules.

Actual: The Token activity heatmap reports 0 tokens for recent days while usage limits are clearly being deducted.

This looks related to the stale Profile usage stats described here, and also related to #26328. It may also overlap with #25762 if timezone/date bucket rendering is involved.

idaibin avatar Jun 17 '26 07:06 idaibin

This is also happening for me

Hans-Huang2004 avatar Jun 17 '26 17:06 Hans-Huang2004

I am seeing the same Profile token activity issue on Codex Desktop for Windows.

Environment

  • Codex Desktop: 26.721.4979.0
  • Windows, x64
  • Plan: Pro
  • Timezone: Asia/Shanghai

Observed

  • Local Codex session logs confirm substantial token usage on July 27, 2026.
  • Profile → Token activity shows no usage for recent dates.
  • A read-only request to /backend-api/wham/profiles/me returned HTTP 200 with a dynamic, freshly generated response.

Backend response evidence

  • generated_at: 2026-07-28T17:58:49Z
  • stats_as_of: 2026-07-27
  • Last daily_usage_buckets entry: 2026-07-26
  • Last bucket tokens: 309647622
  • lifetime_tokens: 26758374311, matching the cumulative total through July 26
  • stats_error: null

This indicates that the desktop UI is displaying the server response correctly, but the Profile backend aggregation has not included usage after July 26. Refreshing the client or changing local cache files cannot correct it.

The rate-limit endpoint continues to update normally, so Profile token activity and usage-limit metering appear to be separate pipelines.

Could the OpenAI team please investigate the Profile aggregation pipeline for this account and clarify the expected update delay for token activity?

LeoSasion avatar Jul 28 '26 18:07 LeoSasion

I can reproduce this on the current macOS desktop app with a freshly generated Profile backend response.

Environment

  • Codex/ChatGPT Desktop: 26.814.41407 (build 6720)
  • macOS 15.7.4, arm64
  • Plan: Pro
  • Timezone: Asia/Shanghai
  • Observed: August 20, 2026

Observed behavior

  • Settings → Profile → Token activity renders August 19 and August 20 as zero-token gray cells.
  • Local session records confirm activity was recorded on both dates:
    • August 19: 23 session files, 46,892 token_count events
    • August 20: 6 session files, 17,002 token_count events
  • A read-only request to /backend-api/wham/profiles/me returned HTTP 200 with a response generated at the time of the check:
{
  "metadata": {
    "stats_as_of": "2026-08-18",
    "generated_at": "2026-08-20T06:42:12.598078Z",
    "stats_error": null
  },
  "stats": {
    "lifetime_tokens": 6939212384,
    "peak_daily_tokens": 447689134,
    "current_streak_days": 2,
    "last_three_buckets": [
      { "start_date": "2026-08-15", "tokens": 165835 },
      { "start_date": "2026-08-17", "tokens": 220511101 },
      { "start_date": "2026-08-18", "tokens": 369131147 }
    ]
  }
}

This narrows the issue down further:

  1. The endpoint response is fresh and reports no stats error, but its aggregation coverage is two calendar days behind.
  2. Dates after metadata.stats_as_of are absent from daily_usage_buckets; the Profile heatmap presents those unprocessed dates as zero usage.
  3. Client refresh, sign-out, or cache clearing cannot resolve the missing buckets.

Even if this aggregation delay is expected, dates after stats_as_of should be rendered as pending/unknown, not as zero. The Profile page should also display an "updated through" date derived from stats_as_of. Please also clarify the expected aggregation delay and backfill behavior.

MokusMokun avatar Aug 20 '26 06:08 MokusMokun

Adding another report: In my situation, the ChatGPT desktop app on Windows does not show my usage for the past two days on the Usage page, even though I used it during that period. The recent usage data is missing. Please investigate whether recent daily usage is delayed or not being included in the displayed history. I do not have the app version at hand.

martinmclee avatar Oct 09 '26 03:10 martinmclee

Adding a reproducible account-usage observation from November 24, 2026.

Environment

  • macOS
  • Timezone: Asia/Shanghai
  • CLI: codex-cli 0.171.0-alpha.13.2

Observed through the app-server

  • Start a new codex app-server --listen stdio:// process, complete the initialize/initialized handshake, and request account/usage/read without a thread ID or date filters.
  • The successful response contains summary, dailyUsageBuckets, and threadUsage.
  • The most recent dailyUsageBuckets[].startDate is 2026-11-22. There are no buckets for 2026-11-23 or 2026-11-24.
  • Repeating the read in fresh app-server processes returns the same missing dates.
  • Local session logs contain positive token_count usage on both missing dates. This establishes local activity, but I am not treating local estimates as exact account-level totals.
  • The downstream chart matches the returned dates and values, so the missing dates are already present in the app-server response rather than being dropped by chart/date formatting.

The app-server response does not expose an aggregation freshness timestamp or an explanation for these missing dates. I cannot determine whether this is delayed aggregation, excluded activity, or another accounting issue. This report concerns daily token activity, not remaining quota percentages.

Could maintainers clarify the expected daily aggregation delay, timezone/cutoff, coverage, and backfill behavior? Exposing an “updated through” date/freshness indicator would let consumers distinguish pending/unavailable dates from confirmed zero usage.

Possibly related: #57854. No shared root cause is assumed.

ZhengYitong2333 avatar Nov 24 '26 13:11 ZhengYitong2333