mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-13 18:32:12 +03:00
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:
committed by
GitHub
parent
ca23eed77c
commit
c68cda7dfb
@@ -31,7 +31,7 @@ import {
|
|||||||
looksLikeQuotaExhausted,
|
looksLikeQuotaExhausted,
|
||||||
type FailureKind,
|
type FailureKind,
|
||||||
} from "../../src/shared/utils/classify429";
|
} 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 { resolveUseUpstream429BreakerHints } from "../../src/shared/utils/providerHints";
|
||||||
import { getCodexModelScope } from "../config/codexQuotaScopes.ts";
|
import { getCodexModelScope } from "../config/codexQuotaScopes.ts";
|
||||||
import { getQuotaScopedModelForProvider } from "./antigravityQuotaFamily.ts";
|
import { getQuotaScopedModelForProvider } from "./antigravityQuotaFamily.ts";
|
||||||
@@ -711,6 +711,8 @@ export function hasPerModelQuota(
|
|||||||
if (getCanonicalLockProvider(provider) === "codex") return true;
|
if (getCanonicalLockProvider(provider) === "codex") return true;
|
||||||
if (provider === "gemini" || provider === "github") return true;
|
if (provider === "gemini" || provider === "github") return true;
|
||||||
if (getPassthroughProviders().has(provider)) return true;
|
if (getPassthroughProviders().has(provider)) return true;
|
||||||
|
const sharedProvider = getProviderById(resolveProviderId(provider));
|
||||||
|
if (sharedProvider?.passthroughModels === true) return true;
|
||||||
if (isCompatibleProvider(provider)) return true;
|
if (isCompatibleProvider(provider)) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -435,6 +435,13 @@ test("hasPerModelQuota returns true for GitHub Copilot provider (#1624)", () =>
|
|||||||
assert.equal(hasPerModelQuota("github", "gpt-5-mini"), true);
|
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", () => {
|
test("Codex Spark 429s are scoped away from normal Codex models", () => {
|
||||||
const connectionId = `codex-${Date.now()}`;
|
const connectionId = `codex-${Date.now()}`;
|
||||||
clearModelLock("codex", connectionId, "gpt-5.3-codex-spark");
|
clearModelLock("codex", connectionId, "gpt-5.3-codex-spark");
|
||||||
|
|||||||
Reference in New Issue
Block a user