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,7 +234,9 @@ 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
const originalProvider = candidates[0]?.provider;
if (candidate.provider === originalProvider) {
attempts.push({ attempts.push({
provider: candidate.provider, provider: candidate.provider,
model: candidate.model, model: candidate.model,
@ -244,6 +246,7 @@ export async function runWithModelFallback<T>(params: {
continue; continue;
} }
} }
}
try { try {
const result = await params.run(candidate.provider, candidate.model); const result = await params.run(candidate.provider, candidate.model);
return { return {