Merge ee78761544 into da71eaebd2
This commit is contained in:
commit
72e9028644
@ -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 {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user