You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the primary, subscription-mode usage reader against the UsageReader interface (#30):
poll the OAuth usage endpoint and degrade gracefully when it is unavailable.
Spec: §6.2 (Reading usage — subscription mode + volatility caveat), §6.1 (Meters), §15 (Open
item: usage-meter polling cadence — resolution direction is the same ~5-min cached poll).
Acceptance criteria
Polls GET https://api.anthropic.com/api/oauth/usage authenticated with the OAuth token from ~/.claude/.credentials.json, header anthropic-beta: oauth-2025-04-20.
Result cached ~5 minutes (per §15 resolution direction); sub-5-minute polling is not done.
Graceful degradation chain — never crashes the run: OAuth endpoint → statusLine stdin (rate_limits.five_hour / .seven_day, Claude Code ≥2.1.x) → token-estimation fallback. The active fallback level is recorded on the snapshot.
Implement the primary, subscription-mode usage reader against the
UsageReaderinterface (#30):poll the OAuth usage endpoint and degrade gracefully when it is unavailable.
Spec: §6.2 (Reading usage — subscription mode + volatility caveat), §6.1 (Meters), §15 (Open
item: usage-meter polling cadence — resolution direction is the same ~5-min cached poll).
Acceptance criteria
GET https://api.anthropic.com/api/oauth/usageauthenticated with the OAuth token from~/.claude/.credentials.json, headeranthropic-beta: oauth-2025-04-20.resets_atforfive_hour,seven_day,seven_day_opus,seven_day_sonnet, and theextra_usageobject (is_enabled,monthly_limit,used_credits,utilization) into the Usage meter model, governing-meter selection, and reader interface #30 meters.rate_limits.five_hour/.seven_day, Claude Code ≥2.1.x) → token-estimation fallback. The active fallback level is recorded on the snapshot.except: pass); a failed read logs and falls back rather than raising.UsageReader, not the OAuth endpoint directly.Depends on: #30
Depends on: #17