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