Skip to content

Provider usage: Claude Code shows "Usage unavailable" when the usage probe fails, although every turn already reports utilization #8492

Backlog

Description

@rergards

Summary

The Provider usage panel shows "Claude Code — Usage unavailable." and bb settings usage --refresh returns an error for claude-code. The usage probe gets rate_limits: null from Claude Code's get_usage control request (backed by /api/oauth/usage, which can answer 429 for days, see #8455). Meanwhile every normal Claude turn already emits a rate_limit_event whose unifiedWindows carry utilization, but bb drops those fields when it normalizes the event, so the panel has nothing to fall back to.

Versions and environment

  • bb desktop app 0.50.1 (macOS). Same code path on main at 6a51b09.
  • macOS 27.2, Apple Silicon.
  • Claude Code 2.1.332, subscription login (OAuth).

Steps to reproduce

  1. Sign in to Claude Code with a subscription account whose /api/oauth/usage currently fails (for example rate-limited with 429).
  2. Run bb settings usage --refresh.
  3. Open the Provider usage panel.
  4. Run any Claude Code turn and inspect the stored event: provider/rateLimits/updated in the events table.

Expected vs actual

Actual (bb settings usage --refresh):

"claude-code": {
  "status": "error",
  "message": "Claude Code could not read this account's plan usage.",
  "planLabel": "Ultra"
}

Actual stored turn event (utilization dropped):

{"providerId":"claude-code","status":"allowed","kind":"subscription-window","windows":[{"providerKey":"seven_day","label":"Weekly limit","status":"allowed","resetsAtMs":1796418000000}],"reachedReason":null,"overageStatus":"rejected","overageReason":"org_level_disabled"}

Raw event from the same Claude Code version (claude -p ... --output-format stream-json --verbose):

{"type":"rate_limit_event","rate_limit_info":{"status":"allowed","resetsAt":1796418000,"rateLimitType":"seven_day","overageStatus":"rejected","overageDisabledReason":"org_level_disabled","isUsingOverage":false,"unifiedWindows":{"seven_day":{"utilization":0.46,"resetsAt":1796418000,"status":"allowed"}}}}

Expected: when the probe fails, the panel, CLI and SDK show the latest turn-derived reading for the same account (46% weekly here), marked as last observed at its observation time, instead of "Usage unavailable".

Evidence

What you ruled out

Suggested priority and effort

Affects every Claude subscription user while the usage endpoint fails; no workaround in the UI. Small, contained fix (draft PR ready).

Activity

  1. added theissue type on Dec 1, 2026
  2. added
    providers
    provider-claude-code
    confirmed-repro
    on Dec 1, 2026
  3. bb-slop-cop commented on Dec 1, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Triage: Bug · Priority: Medium · Effort: Medium · providers, provider-claude-code.

    REPRODUCED (high confidence; confirmed-repro). Reproduction report. Two clean checkouts reproduced the same result: a null usage probe returns an error, and the turn translator drops the weekly usage percentage before it can serve as a fallback. The probe response was simulated; no live OAuth request was made.

    No PR opened: an account-scoped fallback crosses the event contract and server usage policy, so it is not a simple fix.

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

    confirmed-reproprovider-claude-codeproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions