From 97dd4f4f5f9960e9a42a4ae648192b5c9d32b5fd Mon Sep 17 00:00:00 2001 From: Clawd Bot Date: Fri, 30 Jan 2026 01:35:30 +0000 Subject: [PATCH] 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. --- src/agents/pi-embedded-helpers/errors.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/agents/pi-embedded-helpers/errors.ts b/src/agents/pi-embedded-helpers/errors.ts index 849c4293e..5d9769c96 100644 --- a/src/agents/pi-embedded-helpers/errors.ts +++ b/src/agents/pi-embedded-helpers/errors.ts @@ -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; }