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
{{ message }}
Repository navigation
Claude quota polling ignores the Retry-After header and retries failures at 30s, causing sustained 429s on /api/oauth/usage #701
On a real v0.9.15 session (macOS menubar), the Plan section gets stuck on "Couldn't load plan data — Anthropic rate-limited the quota endpoint. Retrying in 1 min." CodexBar polling the same endpoint with the same account and credentials on the same machine is never rate-limited, so this is our request pattern, not the account.
Evidence
org.agentseal.codeburn-menubar defaults on the affected machine show a persisted block (codeburn.claude.usage.blockedUntil = 2026-07-16 20:07:47 +0000) with the cadence at the 2-minute default.
mac/Sources/CodeBurnMenubar/Data/ClaudeSubscriptionService.swift:154-158,182-189 — 429 handling parses retry_after from the JSON body only; the standard Retry-After response header is never read, so we nearly always fall back to a flat 300s and re-probe into a still-open server window (no escalation: the block is overwritten, not maxed).
mac/Sources/CodeBurnMenubar/CodeBurnApp.swift:441-467 — lastSubscriptionRefreshAt only advances on success while the loop ticks every 30s (CodeBurnApp.swift:5), so any transient failure escalates polling from the 2-minute cadence to one request per 30s until a success — the burst that trips the limit in the first place.
CodeBurnApp.swift:501-512 — the popover-open 30s floor is an OR across providers, force-fetching Claude even when it was fetched seconds ago; SettingsView.swift:276 and HeatmapSection.swift:1727,1734 bypass the single-flight in CodeBurnApp.swift:472-487.
Comparison: CodexBar honors Retry-After (both delta-seconds and HTTP-date), escalates its block with max(existing, candidate), and uses an adaptive cadence — same endpoint, no 429s.
Proposed fix
Parse the Retry-After header on 429 (fallback: body retry_after, then 300s) and record max(existing, new) so repeated 429s escalate instead of resetting.
Anchor refresh cadence on attempt time, with exponential backoff + jitter for failures capped at the configured cadence — never retry hotter than steady state.
Make the popover-open floor per-provider.
Route the Settings/Plan-tab retry buttons through the AppDelegate single-flight.
Working on this. Approach as proposed: header-first Retry-After parsing with max-escalation on the persisted block, attempt-anchored cadence with capped backoff for failures, per-provider popover floor, and interactive retries routed through the single-flight.
Activity
avs-io commentedon Jul 16, 2026
Working on this. Approach as proposed: header-first Retry-After parsing with max-escalation on the persisted block, attempt-anchored cadence with capped backoff for failures, per-provider popover floor, and interactive retries routed through the single-flight.
menubar: honor Retry-After on Claude quota 429s, back off failed refr…