fix(errors): recognize auth profile cooldown as rate_limit

Improve error classification to allow fallback when all auth profiles
for a provider are in cooldown.

Previously, errors like 'No available auth profile for google-gemini-cli
(all in cooldown or unavailable)' could be misclassified, preventing
fallback to backup models. By explicitly classifying this specific
pattern as 'rate_limit', we ensure the intended failover behavior.
This commit is contained in:
Clawd Bot 2026-01-30 01:35:30 +00:00
parent 4583f88626
commit 97dd4f4f5f

View File

@ -504,6 +504,8 @@ export function classifyFailoverReason(raw: string): FailoverReason | null {
if (isCloudCodeAssistFormatError(raw)) return "format";
if (isBillingErrorMessage(raw)) return "billing";
if (isTimeoutErrorMessage(raw)) return "timeout";
// Check for specific auth profile unavailability/cooldown patterns to allow fallback
if (/no available auth profile.*all in cooldown/i.test(raw)) return "rate_limit";
if (isAuthErrorMessage(raw)) return "auth";
return null;
}