fix(gemini): filter out locked models during credential selection

isModelLocked() was called to lock models on 429 but never checked
when selecting connections. Requests to a locked model would still
route to it, causing unnecessary repeated 429s.
This commit is contained in:
Chris Staley
2026-04-02 15:18:36 -06:00
parent f8d045c275
commit 03ff03ed52

View File

@@ -408,6 +408,8 @@ export async function getProviderCredentials(
if (isAccountUnavailable(c.rateLimitedUntil)) return false;
if (isTerminalConnectionStatus(c)) return false;
if (provider === "codex" && isCodexScopeUnavailable(c, requestedModel)) return false;
// Per-model lockout: if this specific model is locked on this connection, skip it
if (requestedModel && isModelLocked(provider, c.id, requestedModel)) return false;
}
return true;
});