Repository navigation
Description
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
mainat 6a51b09. - macOS 27.2, Apple Silicon.
- Claude Code 2.1.332, subscription login (OAuth).
Steps to reproduce
- Sign in to Claude Code with a subscription account whose
/api/oauth/usagecurrently fails (for example rate-limited with 429). - Run
bb settings usage --refresh. - Open the Provider usage panel.
- Run any Claude Code turn and inspect the stored event:
provider/rateLimits/updatedin theeventstable.
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
- Probe:
plugins/provider-claude-codeprobeClaudeUsage->usage_EXPERIMENTAL_MAY_CHANGE_DO_NOT_RELY_ON_THIS_API_YET({ skipBehaviors: true });rate_limits === nullyields the error above. - Normalization of
rate_limit_infoinplugins/provider-claude-code/src/delta-translation.tskeeps status/reset/overage but notutilization/unifiedWindows. - Agent SDK reference documents
utilizationas a 0-1 fraction: https://code.claude.com/docs/en/agent-sdk/python#ratelimitinfo
What you ruled out
- Not Show stale and rate-limited usage honestly in the usage panel #8455: that change makes stale and rate-limited readings honest, but adds no alternative data source for Claude Code.
- Not Provider usage: Claude Code per-model weekly limit (Fable) disappears when the CLI serves "seeded" usage data #8306/Preserve Claude model usage when canonical limits are unavailable #8307: those cover model-scoped windows when canonical limits are missing, not a null
rate_limits. - Not a login problem:
rate_limits_availableis true and normal turns work.
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
bb-slop-cop commentedon Dec 1, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotTriage: 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.