Skip to content

[Bug]: Claude usage view renders stale snapshot first (28%→0% flip), drops unifiedWindows-only rate events, duplicates same account across machines #17488

Open

Description

@amihos

Build: T3-Code nightly (AppImage), linux, claude 2.1.x
Setup: two boxes, same Claude Pro subscription and auth token, claudeAgent_stock instance.

Repro 1 — stale-first flip:

  1. Hit Claude session rate limit (warning received).
  2. Open usage view.
  3. Bars show Session 28% left, Weekly 94% left for ~1s, then flip to Session 0% left, Weekly 92% left.

The second reading is correct. The first is stale and misleading.

Evidence: the on-disk provider cache (caches/claudeAgent_stock.json, checkedAt shortly before opening) holds five_hour.usedPercent: 72 (= 28% left) and seven_day.usedPercent: 6 (= 94% left) — exactly the first render. The second render matches the fresh probe.

Suspected cause (from built bundles, nightly 20261009):

  • Capabilities probe (usage) is cached with a 5-minute TTL (CAPABILITIES_PROBE_TTL); the view renders the disk snapshot first, then the background probe lands ~1s later.
  • The server notes a deliberate trade-off: a successful probe "replaces the published windows outright, including any runtime update that landed while it was running." A slow probe can clobber the fresh rate_limit_event merge (applyUsageLimitsUpdate).
  • The rate-event mapper requires top-level utilization and ignores events otherwise. Current allowed events in logs/provider/events.*.log carry only unifiedWindows (e.g. five_hour.utilization without a top-level field), so live updates are dropped; only warning-shaped events update.

Expected: never present a stale snapshot as live (show refreshing/stale state with checkedAt age), apply unifiedWindows from all rate events, and make probe-vs-event reconciliation freshest-wins per window instead of outright replace.

Repro 2 — same account side by side:

  1. With both boxes online, usage showed the same subscription twice, side by side.
  2. Later it showed once.

Suspected cause (client ChatGptUsageButton merge/group helpers):

  • Merge key is driver:email-lower, else driver:credential:fingerprint, else env:instanceId. Same email merges; missing email (probe pending/failed) falls back to per-env keys, producing duplicates.
  • Grouped windows average usedPercent across co-grouped accounts. For one account seen twice this is wrong; freshest checkedAt should win.

Expected: stable single row per account once identity resolves; freshest-wins instead of average for identical accounts.

Activity

  1. khibroxe commented on Oct 9, 2026

    @khibroxe

    I can confirm the unifiedWindows-only part on macOS: T3 Code Nightly 0.0.46-nightly.20261009.2873, Claude Code CLI 2.1.295, and Claude Pro.

    Every allowed event in my provider logs has this shape, about 1,400 of them across my threads:

    {
      "type": "rate_limit_event",
      "rate_limit_info": {
        "status": "allowed",
        "resetsAt": 1791579000,
        "rateLimitType": "five_hour",
        "overageStatus": "rejected",
        "overageDisabledReason": "org_level_disabled",
        "isUsingOverage": false,
        "unifiedWindows": {
          "five_hour": { "utilization": 0.5, "resetsAt": 1791579000 },
          "seven_day": { "utilization": 0.26, "resetsAt": 1792072800 }
        }
      }
    }

    claudeRateLimitEventToUpdate returns early on typeof info.utilization !== "number", so onUsageLimits never fires. Here the startup probe also gets rate_limits: null (#15364), so these events are the only source of Claude limits, and they are all dropped. Reading each unifiedWindows entry (scaled by 100) when the top-level utilization is missing would fix this case.

  2. mattesick commented on Oct 11, 2026

    @mattesick

    Additional report for the same-account-across-machines part of this issue.

    @maria-rcks, this is related to your merged PR #17711, which keeps Personal and Team workspaces separate for one email while still merging the same workspace across environments. The problem here is two computers signed into the same Claude Team login and workspace.

    Reproduction

    1. Sign into the same Claude Team account and workspace on two computers.
    2. Connect both computers to T3 Code.
    3. Open Usage → Limits and hover each of the two Claude Work entries.

    The two supplied screenshots show the following tooltips:

    Field First computer Second computer
    Plan Claude Team Subscription Claude Team Subscription
    Signed in Mattias's MacBook Pro (2) tahoeqa1-Inspiron-16-7610
    Weekly left 0% 0%
    Resets 10/14 3:00 PM, in 2d 20h 10/14 3:00 PM, in 2d 20h
    Restores +20% of pool +20% of pool

    Actual behavior

    The same Team quota occupies two Work bars and contributes two 20% shares, totaling 40% of the displayed pool, even though there is only one underlying Team quota. This distorts the overall remaining percentage and reset contribution.

    The screenshots also show both Work bars at 99% in Weekly · Fable, with the same reset countdown. The Claude cards show Session 80% left, Weekly 14% left, and Weekly · Fable 81% left. These are screenshot observations, not an independently reproduced test.

    Expected behavior

    Count one provider account and workspace once in the pool, even when it is signed in on several computers. Both computer names can remain available as login sources for that one quota. Keep genuinely different Personal and Team workspaces separate, as intended by #17711. Deduplicate before calculating account weights, total remaining quota, and reset contributions.

    Please check whether the two computers are reporting different or missing workspace identities and whether differing server versions affect the merge. I have not established the root cause or that #17711 caused a regression.

    Environment and evidence

    Reported on October 11, 2026. The reporting Mac has T3 Code Nightly 0.0.46-nightly.20261011.2980 installed and runs macOS 15.7.4. The other computer's version and OS were not verified.

    Two screenshots were supplied with this report. Their relevant values are transcribed above. The images themselves are not attached here because the available GitHub browser session is signed out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions