• bot's avatar
    fix: handle Anthropic credit balance exhausted (400) as account error · cb016ad8
    bot authored
    When an Anthropic API key's credit balance is depleted, the upstream
    returns HTTP 400 with message containing "credit balance". Previously,
    the 400 handler only checked for "organization has been disabled",
    so credit-exhausted accounts kept being scheduled — every request
    returned the same error.
    
    Treat this case identically to 402 (Payment Required): call
    handleAuthError → SetError to stop scheduling the account until
    an admin manually recovers it after topping up credits.
    
    Closes #1586
    cb016ad8
ratelimit_service.go 54.1 KB