fix(resilience): honor shared passthrough providers (#11075)

5 — Fornecedores locais compartilhados (ollama-local, LM Studio, vLLM) declaram passthroughModels:true no registry, mas hasPerModelQuota() não consultava o registry compartilhado — fallha de modelo faltante virava cooldown de conexão inteira. Broadens a classificação de model-lockout. TDD + 78/291 testes + typecheck + lint verdes. Fecha #11071.
This commit is contained in:
Praveen K Palaniswamy
2026-08-21 21:06:21 -04:00
committed by GitHub
parent ca23eed77c
commit c68cda7dfb
2 changed files with 10 additions and 1 deletions

View File

@@ -31,7 +31,7 @@ import {
looksLikeQuotaExhausted,
type FailureKind,
} from "../../src/shared/utils/classify429";
import { resolveProviderId } from "../../src/shared/constants/providers";
import { getProviderById, resolveProviderId } from "../../src/shared/constants/providers";
import { resolveUseUpstream429BreakerHints } from "../../src/shared/utils/providerHints";
import { getCodexModelScope } from "../config/codexQuotaScopes.ts";
import { getQuotaScopedModelForProvider } from "./antigravityQuotaFamily.ts";
@@ -711,6 +711,8 @@ export function hasPerModelQuota(
if (getCanonicalLockProvider(provider) === "codex") return true;
if (provider === "gemini" || provider === "github") return true;
if (getPassthroughProviders().has(provider)) return true;
const sharedProvider = getProviderById(resolveProviderId(provider));
if (sharedProvider?.passthroughModels === true) return true;
if (isCompatibleProvider(provider)) return true;
return false;
}

View File

@@ -435,6 +435,13 @@ test("hasPerModelQuota returns true for GitHub Copilot provider (#1624)", () =>
assert.equal(hasPerModelQuota("github", "gpt-5-mini"), true);
});
test("hasPerModelQuota honors shared passthrough provider metadata (#11071)", () => {
assert.equal(hasPerModelQuota("ollama-local"), true);
assert.equal(hasPerModelQuota("lm-studio"), true);
assert.equal(hasPerModelQuota("vllm"), true);
assert.equal(hasPerModelQuota("mlx-gemma"), false);
});
test("Codex Spark 429s are scoped away from normal Codex models", () => {
const connectionId = `codex-${Date.now()}`;
clearModelLock("codex", connectionId, "gpt-5.3-codex-spark");