mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-27 02:12:19 +03:00
Compare commits
2 Commits
fix/candid
...
fix/handle
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23686bc6f6 | ||
|
|
62ced83caa |
@@ -77,6 +77,7 @@ import {
|
||||
isAntigravityMissingProjectError,
|
||||
PROVIDER_BREAKER_FAILURE_STATUSES,
|
||||
shouldTripProviderBreakerForResult,
|
||||
PROVIDER_BREAKER_FAILURE_STATUSES,
|
||||
} from "./chatPredicates";
|
||||
import { connectionHasExtraKeys } from "@omniroute/open-sse/services/apiKeyRotator.ts";
|
||||
import {
|
||||
|
||||
@@ -87,9 +87,9 @@ test("credentialed providers expose one logical candidate per visible registry m
|
||||
);
|
||||
for (const model of [
|
||||
"antigravity/claude-sonnet-4-6",
|
||||
"antigravity/gemini-3.6-flash-low",
|
||||
"antigravity/gemini-3.6-flash-medium",
|
||||
"antigravity/gemini-3.6-flash-high",
|
||||
"antigravity/gemini-3-flash-agent",
|
||||
"antigravity/gemini-3.5-flash-low",
|
||||
"antigravity/gemini-3.5-flash-extra-low",
|
||||
]) {
|
||||
assert.ok(modelStrings.includes(model), `${model} should be eligible for auto routing`);
|
||||
}
|
||||
@@ -134,10 +134,8 @@ test("connection model exclusions narrow only that model's account allowlist", a
|
||||
assert.deepEqual(candidate.allowedConnectionIds, [second.id]);
|
||||
}
|
||||
|
||||
const sonnet = candidates.find(
|
||||
(candidate) => candidate.model === "antigravity/claude-sonnet-4-6"
|
||||
);
|
||||
assert.ok(sonnet, "Claude Sonnet 5 should remain in the candidate pool");
|
||||
const sonnet = candidates.find((candidate) => candidate.model === "antigravity/claude-sonnet-4-6");
|
||||
assert.ok(sonnet, "Claude Sonnet 4.6 should remain in the candidate pool");
|
||||
assert.deepEqual([...(sonnet.allowedConnectionIds ?? [])].sort(), [first.id, second.id].sort());
|
||||
});
|
||||
|
||||
@@ -150,9 +148,9 @@ test("hiding the first registry model does not drop the credentialed provider",
|
||||
|
||||
assert.equal(modelStrings.includes("antigravity/claude-sonnet-4-6"), false);
|
||||
for (const model of [
|
||||
"antigravity/gemini-3.6-flash-low",
|
||||
"antigravity/gemini-3.6-flash-medium",
|
||||
"antigravity/gemini-3.6-flash-high",
|
||||
"antigravity/gemini-3-flash-agent",
|
||||
"antigravity/gemini-3.5-flash-low",
|
||||
"antigravity/gemini-3.5-flash-extra-low",
|
||||
]) {
|
||||
assert.ok(modelStrings.includes(model), `${model} should remain after Sonnet is hidden`);
|
||||
}
|
||||
|
||||
@@ -42,8 +42,6 @@ test("default model alias seed writes missing aliases and is idempotent", async
|
||||
assert.equal(aliases["gemini-3-flash-preview"], undefined);
|
||||
|
||||
const routed = await sseModelService.getModelInfo("gemini-3.1-pro");
|
||||
// The stored alias target is "agy/gemini-pro-agent", but getModelInfo canonicalizes
|
||||
// the "agy" alias to its provider id "antigravity" (ALIAS_TO_PROVIDER_ID, #8013).
|
||||
assert.deepEqual(routed, {
|
||||
provider: "antigravity",
|
||||
model: "gemini-pro-agent",
|
||||
|
||||
@@ -189,7 +189,11 @@ test("getProviderConcurrencyCap resolves override -> static default -> fallback"
|
||||
);
|
||||
setProviderQuotaOverrides({ nvidia: { concurrency: 3 } });
|
||||
try {
|
||||
assert.equal(getProviderConcurrencyCap("nvidia", 99), 3, "override wins over the static default");
|
||||
assert.equal(
|
||||
getProviderConcurrencyCap("nvidia", 99),
|
||||
3,
|
||||
"override wins over the static default"
|
||||
);
|
||||
} finally {
|
||||
setProviderQuotaOverrides(null);
|
||||
}
|
||||
@@ -218,16 +222,9 @@ test("nvidia 429 does not trip the provider circuit breaker (unchanged 408/500/5
|
||||
// documentation-alignment guard proving Phase 1 didn't accidentally widen
|
||||
// PROVIDER_BREAKER_FAILURE_STATUSES to include 429 (which would collapse the
|
||||
// per-model lockout this PR adds into a whole-connection/provider outage).
|
||||
// #8013 extracted the const from src/sse/handlers/chat.ts into chatPredicates.ts
|
||||
// (still consumed by chat.ts's breaker paths) — read the declaration from its
|
||||
// current home.
|
||||
const chatHandlerPath = path.join(
|
||||
process.cwd(),
|
||||
"src",
|
||||
"sse",
|
||||
"handlers",
|
||||
"chatPredicates.ts"
|
||||
);
|
||||
// The PROVIDER_BREAKER_FAILURE_STATUSES declaration was extracted from chat.ts into
|
||||
// the sibling chatPredicates.ts (chat.ts now imports it); read it from its home.
|
||||
const chatHandlerPath = path.join(process.cwd(), "src", "sse", "handlers", "chatPredicates.ts");
|
||||
const source = fs.readFileSync(chatHandlerPath, "utf8");
|
||||
const match = source.match(/PROVIDER_BREAKER_FAILURE_STATUSES\s*=\s*new Set\(\[([^\]]+)\]\)/);
|
||||
assert.ok(match, "PROVIDER_BREAKER_FAILURE_STATUSES declaration found");
|
||||
|
||||
@@ -15,14 +15,11 @@ const {
|
||||
capThinkingBudget,
|
||||
} = await import("../../src/shared/constants/modelSpecs.ts");
|
||||
|
||||
test("T31: antigravity static catalog exposes client-visible Gemini preview IDs", () => {
|
||||
// Antigravity exposes client-visible Gemini IDs even though the upstream still
|
||||
// accepts its internal model identifiers. #8013 (align official clients / callable
|
||||
// catalog) retired the `gemini-3-pro-preview` alias, so assert the current
|
||||
// client-visible top flash tier instead.
|
||||
test("T31: antigravity static catalog exposes client-visible Gemini model IDs", () => {
|
||||
// Antigravity's static catalog surfaces the live, client-visible model IDs returned by
|
||||
// the model selector (#8013 refactor: gemini-3.6-flash-high is the current defaultAgentModelId).
|
||||
const staticIds = (getStaticModelsForProvider("antigravity") || []).map((m) => m.id);
|
||||
assert.ok(staticIds.includes("gemini-3.6-flash-high"));
|
||||
assert.ok(!staticIds.includes("gemini-3-pro-preview"));
|
||||
// #3303 (agy parity, discussion #3184): the Gemini + Claude budget tiers ARE
|
||||
// client-visible on the Antigravity OAuth backend (Claude was never removed).
|
||||
assert.ok(staticIds.includes("gemini-3.1-pro-low"));
|
||||
|
||||
Reference in New Issue
Block a user