mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-12 02:02:13 +03:00
Anthropic rate-limits the OAuth quota endpoint (`/api/oauth/usage`) independently of `/v1/messages`. When several connections polled at once, the dashboard hammered it and surfaced noisy 429s. After a 429 we now cool down OAuth usage polling for that access token (3 min) and transparently fall back to the legacy settings/org endpoint — chat with the same token is unaffected. The cooldown lives in a small pure helper module (`open-sse/services/claudeUsageCooldown.ts`) so the policy is TDD-covered without touching fetch. Co-authored-by: decolua <decoluadt@example.com> Inspired-by: https://github.com/decolua/9router/commit/79df34ca