diff --git a/open-sse/services/accountFallback.ts b/open-sse/services/accountFallback.ts index 5204c7410d..900e8b6224 100644 --- a/open-sse/services/accountFallback.ts +++ b/open-sse/services/accountFallback.ts @@ -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; } diff --git a/tests/unit/account-fallback-service.test.ts b/tests/unit/account-fallback-service.test.ts index 26da5a7d5a..9ee2ba08ca 100644 --- a/tests/unit/account-fallback-service.test.ts +++ b/tests/unit/account-fallback-service.test.ts @@ -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");