- Shipped
- November 13, 2026 at 12:29 AM UTC
- Author
- Kamo
- Commit
- 0380c33
- Provider errors are classified from the provider's own body: INSUFFICIENT_QUOTA (insufficient_quota, billing, 402, low credit), RATE_LIMITED (a real 429), AUTH (401/403), OUTAGE (5xx, timeouts). ai_usage_records.error_message keeps '[KIND] HTTP 429 <code>: <message>' (sanitized: no key, no prompt, 300 chars); status_detail keeps it too. - Circuit breaker per provider: out of credit opens OUT_OF_CREDIT at once, three rejected keys AUTH_FAILED (Key Rejected). The router skips both for live and background traffic; the next provider is tried; all blocked makes org availability OFF. A rate limit cools the provider for its Retry-After instead (no breaker). - Re-check by one tiny real completion (not /models): on a 15 min doubling to 6 h backoff (BreakerProbeJob), at once on a key edit, and on Test Connection (Check Now), which now answers the provider's sentence. - One bell-only notice (no email/text/push) to the org's Manage SI Settings holders when a breaker opens, withdrawn when it closes. - GET /api/ai/org-availability (any member, own org) for the UI.
