This commit is contained in:
BlackBearCC 2026-01-30 11:55:32 +00:00 committed by GitHub
commit 72e9028644
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -234,14 +234,17 @@ export async function runWithModelFallback<T>(params: {
const isAnyProfileAvailable = profileIds.some((id) => !isProfileInCooldown(authStore, id)); const isAnyProfileAvailable = profileIds.some((id) => !isProfileInCooldown(authStore, id));
if (profileIds.length > 0 && !isAnyProfileAvailable) { if (profileIds.length > 0 && !isAnyProfileAvailable) {
// All profiles for this provider are in cooldown; skip without attempting // Only skip if this provider is the same as the original one to ensure fallbacks to other providers are still tried
attempts.push({ const originalProvider = candidates[0]?.provider;
provider: candidate.provider, if (candidate.provider === originalProvider) {
model: candidate.model, attempts.push({
error: `Provider ${candidate.provider} is in cooldown (all profiles unavailable)`, provider: candidate.provider,
reason: "rate_limit", model: candidate.model,
}); error: `Provider ${candidate.provider} is in cooldown (all profiles unavailable)`,
continue; reason: "rate_limit",
});
continue;
}
} }
} }
try { try {