Provider usage endpoint degrades gracefully instead of 500
/dashboard/api/provider/{id}/usage returned HTTP 500 whenever a usage fetch
failed — most commonly when a provider's OAuth credentials are expired/invalid
(e.g. the codex_* providers). The Providers dashboard polls every provider's
usage on a timer, so this spammed 500s (visible in nginx/access logs) for any
stale-credential provider.
A monitoring poll failing is an expected soft condition, not a server error.
Return 200 with usage:None and an 'unavailable' flag so the UI can render an
offline state; genuine data still returns normally.
Co-Authored-By:
Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Showing
Please
register
or
sign in
to comment