feat(models): adopt CLI catalog, pricing, and version fallbacks from #12499 (#13318)

This commit is contained in:
Tuan Dinh
2026-09-15 23:26:33 +07:00
parent 5c75d07e09
commit be65c76190
5 changed files with 34 additions and 24 deletions

View File

@@ -0,0 +1 @@
- **feat(models):** add Gemini 3.8 Flash tiers to Antigravity and AGY catalogs ([#13318](https://github.com/diegosouzapw/OmniRoute/pull/13318)) — thanks @tuandinh0801, with credit to #12499 (@Abhishekchhetri020)

View File

@@ -5,8 +5,8 @@ const ANTIGRAVITY_CLI_RELEASE_URL =
export const ANTIGRAVITY_VERSION_CACHE_TTL_MS = 6 * 60 * 60 * 1000; export const ANTIGRAVITY_VERSION_CACHE_TTL_MS = 6 * 60 * 60 * 1000;
export const ANTIGRAVITY_VERSION_FETCH_TIMEOUT_MS = 5_000; export const ANTIGRAVITY_VERSION_FETCH_TIMEOUT_MS = 5_000;
export const ANTIGRAVITY_IDE_FALLBACK_VERSION = "2.1.1"; export const ANTIGRAVITY_IDE_FALLBACK_VERSION = "2.5.5";
export const ANTIGRAVITY_CLI_FALLBACK_VERSION = "1.1.5"; export const ANTIGRAVITY_CLI_FALLBACK_VERSION = "1.1.24";
type VersionCache = { type VersionCache = {
fetchedAt: number; fetchedAt: number;

View File

@@ -242,6 +242,9 @@ export const CLI_TOOLS: Record<string, CliCatalogEntry> = {
acpSpawnable: false, acpSpawnable: false,
baseUrlSupport: "none", baseUrlSupport: "none",
modelAliases: [ modelAliases: [
"gemini-3.8-flash-high",
"gemini-3.8-flash-medium",
"gemini-3.8-flash-low",
"gemini-3.7-flash-high", "gemini-3.7-flash-high",
"gemini-3.7-flash-medium", "gemini-3.7-flash-medium",
"gemini-3.7-flash-low", "gemini-3.7-flash-low",
@@ -252,6 +255,9 @@ export const CLI_TOOLS: Record<string, CliCatalogEntry> = {
"gpt-oss-120b-medium", "gpt-oss-120b-medium",
], ],
defaultModels: [ defaultModels: [
createCliModel("gemini-3.8-flash-high", "Gemini 3.8 Flash High"),
createCliModel("gemini-3.8-flash-medium", "Gemini 3.8 Flash Medium"),
createCliModel("gemini-3.8-flash-low", "Gemini 3.8 Flash Low"),
createCliModel("gemini-3.7-flash-high", "Gemini 3.7 Flash High"), createCliModel("gemini-3.7-flash-high", "Gemini 3.7 Flash High"),
createCliModel("gemini-3.7-flash-medium", "Gemini 3.7 Flash Medium"), createCliModel("gemini-3.7-flash-medium", "Gemini 3.7 Flash Medium"),
createCliModel("gemini-3.7-flash-low", "Gemini 3.7 Flash Low"), createCliModel("gemini-3.7-flash-low", "Gemini 3.7 Flash Low"),

View File

@@ -15,6 +15,9 @@ import {
} from "./shared-tiers"; } from "./shared-tiers";
const ANTIGRAVITY_GEMINI_3_7_PRICING = { const ANTIGRAVITY_GEMINI_3_7_PRICING = {
"gemini-3.8-flash-low": GEMINI_3_7_FLASH_PROMO_PRICING,
"gemini-3.8-flash-medium": GEMINI_3_7_FLASH_PROMO_PRICING,
"gemini-3.8-flash-high": GEMINI_3_7_FLASH_PROMO_PRICING,
"gemini-3.7-flash-low": GEMINI_3_7_FLASH_PROMO_PRICING, "gemini-3.7-flash-low": GEMINI_3_7_FLASH_PROMO_PRICING,
"gemini-3.7-flash-medium": GEMINI_3_7_FLASH_PROMO_PRICING, "gemini-3.7-flash-medium": GEMINI_3_7_FLASH_PROMO_PRICING,
"gemini-3.7-flash-high": GEMINI_3_7_FLASH_PROMO_PRICING, "gemini-3.7-flash-high": GEMINI_3_7_FLASH_PROMO_PRICING,

View File

@@ -24,29 +24,29 @@ test.afterEach(() => {
test("IDE and CLI start with independent captured fallback versions", () => { test("IDE and CLI start with independent captured fallback versions", () => {
assert.equal(getCachedAntigravityIdeVersion(), ANTIGRAVITY_IDE_FALLBACK_VERSION); assert.equal(getCachedAntigravityIdeVersion(), ANTIGRAVITY_IDE_FALLBACK_VERSION);
assert.equal(getCachedAntigravityCliVersion(), ANTIGRAVITY_CLI_FALLBACK_VERSION); assert.equal(getCachedAntigravityCliVersion(), ANTIGRAVITY_CLI_FALLBACK_VERSION);
assert.equal(ANTIGRAVITY_IDE_FALLBACK_VERSION, "2.1.1"); assert.equal(ANTIGRAVITY_IDE_FALLBACK_VERSION, "2.5.5");
assert.equal(ANTIGRAVITY_CLI_FALLBACK_VERSION, "1.1.5"); assert.equal(ANTIGRAVITY_CLI_FALLBACK_VERSION, "1.1.24");
}); });
test("IDE resolver reads the official updater feed and caches only the IDE version", async () => { test("IDE resolver reads the official updater feed and caches only the IDE version", async () => {
const urls: string[] = []; const urls: string[] = [];
const fetchMock = async (url: string | URL | Request) => { const fetchMock = async (url: string | URL | Request) => {
urls.push(String(url)); urls.push(String(url));
return new Response(JSON.stringify([{ version: "2.2.0", execution_id: "ide-release" }]), { return new Response(JSON.stringify([{ version: "2.6.0", execution_id: "ide-release" }]), {
status: 200, status: 200,
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}); });
}; };
assert.equal(await resolveAntigravityIdeVersion(fetchMock as typeof fetch), "2.2.0"); assert.equal(await resolveAntigravityIdeVersion(fetchMock as typeof fetch), "2.6.0");
assert.equal(await resolveAntigravityIdeVersion(fetchMock as typeof fetch), "2.2.0"); assert.equal(await resolveAntigravityIdeVersion(fetchMock as typeof fetch), "2.6.0");
assert.equal(urls.length, 1); assert.equal(urls.length, 1);
assert.equal( assert.equal(
urls[0], urls[0],
"https://antigravity-auto-updater-974169037036.us-central1.run.app/releases" "https://antigravity-auto-updater-974169037036.us-central1.run.app/releases"
); );
assert.equal(getCachedAntigravityIdeVersion(), "2.2.0"); assert.equal(getCachedAntigravityIdeVersion(), "2.6.0");
assert.equal(getCachedAntigravityCliVersion(), "1.1.5"); assert.equal(getCachedAntigravityCliVersion(), ANTIGRAVITY_CLI_FALLBACK_VERSION);
}); });
test("IDE resolver selects the newest feed entry and never falls below its version floor", async () => { test("IDE resolver selects the newest feed entry and never falls below its version floor", async () => {
@@ -54,14 +54,14 @@ test("IDE resolver selects the newest feed entry and never falls below its versi
new Response( new Response(
JSON.stringify([ JSON.stringify([
{ version: "2.0.0" }, { version: "2.0.0" },
{ version: "2.4.0" }, { version: "2.6.0" },
{ version: "2.2.0" }, { version: "2.6.0" },
{ version: "invalid" }, { version: "invalid" },
]), ]),
{ status: 200, headers: { "Content-Type": "application/json" } } { status: 200, headers: { "Content-Type": "application/json" } }
); );
assert.equal(await resolveAntigravityIdeVersion(mixedFeedFetch as typeof fetch), "2.4.0"); assert.equal(await resolveAntigravityIdeVersion(mixedFeedFetch as typeof fetch), "2.6.0");
clearAntigravityVersionCaches(); clearAntigravityVersionCaches();
const staleFeedFetch = async () => const staleFeedFetch = async () =>
@@ -80,7 +80,7 @@ test("IDE resolver selects the newest feed entry and never falls below its versi
test("IDE resolver keeps a newer cached version when a later feed response is older", async () => { test("IDE resolver keeps a newer cached version when a later feed response is older", async () => {
let now = 1_000; let now = 1_000;
Date.now = () => now; Date.now = () => now;
seedAntigravityIdeVersionCache("2.5.0", now); seedAntigravityIdeVersionCache("2.6.0", now);
now += ANTIGRAVITY_VERSION_CACHE_TTL_MS + 1; now += ANTIGRAVITY_VERSION_CACHE_TTL_MS + 1;
const olderFeedFetch = async () => const olderFeedFetch = async () =>
@@ -89,8 +89,8 @@ test("IDE resolver keeps a newer cached version when a later feed response is ol
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}); });
assert.equal(await resolveAntigravityIdeVersion(olderFeedFetch as typeof fetch), "2.5.0"); assert.equal(await resolveAntigravityIdeVersion(olderFeedFetch as typeof fetch), "2.6.0");
assert.equal(getCachedAntigravityIdeVersion(), "2.5.0"); assert.equal(getCachedAntigravityIdeVersion(), "2.6.0");
}); });
test("CLI resolver reads the official Google GitHub release and caches only the CLI version", async () => { test("CLI resolver reads the official Google GitHub release and caches only the CLI version", async () => {
@@ -111,7 +111,7 @@ test("CLI resolver reads the official Google GitHub release and caches only the
"https://api.github.com/repos/google-antigravity/antigravity-cli/releases/latest" "https://api.github.com/repos/google-antigravity/antigravity-cli/releases/latest"
); );
assert.equal(getCachedAntigravityCliVersion(), "1.2.0"); assert.equal(getCachedAntigravityCliVersion(), "1.2.0");
assert.equal(getCachedAntigravityIdeVersion(), "2.1.1"); assert.equal(getCachedAntigravityIdeVersion(), ANTIGRAVITY_IDE_FALLBACK_VERSION);
}); });
test("IDE and CLI TTL refreshes are independent", async () => { test("IDE and CLI TTL refreshes are independent", async () => {
@@ -120,19 +120,19 @@ test("IDE and CLI TTL refreshes are independent", async () => {
seedAntigravityCliVersionCache("1.1.5", now); seedAntigravityCliVersionCache("1.1.5", now);
const firstFetch = async () => const firstFetch = async () =>
new Response(JSON.stringify([{ version: "2.2.0" }]), { new Response(JSON.stringify([{ version: "2.6.0" }]), {
status: 200, status: 200,
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}); });
const secondFetch = async () => const secondFetch = async () =>
new Response(JSON.stringify([{ version: "2.3.0" }]), { new Response(JSON.stringify([{ version: "2.7.0" }]), {
status: 200, status: 200,
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}); });
assert.equal(await resolveAntigravityIdeVersion(firstFetch as typeof fetch), "2.2.0"); assert.equal(await resolveAntigravityIdeVersion(firstFetch as typeof fetch), "2.6.0");
now += ANTIGRAVITY_VERSION_CACHE_TTL_MS + 1; now += ANTIGRAVITY_VERSION_CACHE_TTL_MS + 1;
assert.equal(await resolveAntigravityIdeVersion(secondFetch as typeof fetch), "2.3.0"); assert.equal(await resolveAntigravityIdeVersion(secondFetch as typeof fetch), "2.7.0");
assert.equal(getCachedAntigravityCliVersion(), "1.1.5"); assert.equal(getCachedAntigravityCliVersion(), "1.1.5");
}); });
@@ -150,9 +150,9 @@ test("each resolver falls back only to its own last known good version", async (
ANTIGRAVITY_CLI_FALLBACK_VERSION ANTIGRAVITY_CLI_FALLBACK_VERSION
); );
seedAntigravityIdeVersionCache("2.4.0", 0); seedAntigravityIdeVersionCache("2.6.0", 0);
seedAntigravityCliVersionCache("1.3.0", 0); seedAntigravityCliVersionCache("1.3.0", 0);
assert.equal(await resolveAntigravityIdeVersion(failingFetch as typeof fetch), "2.4.0"); assert.equal(await resolveAntigravityIdeVersion(failingFetch as typeof fetch), "2.6.0");
assert.equal(await resolveAntigravityCliVersion(failingFetch as typeof fetch), "1.3.0"); assert.equal(await resolveAntigravityCliVersion(failingFetch as typeof fetch), "1.3.0");
}); });
@@ -171,7 +171,7 @@ test("concurrent requests coalesce within each product without crossing products
const ideFetch = async () => { const ideFetch = async () => {
ideCalls += 1; ideCalls += 1;
await ideGate; await ideGate;
return new Response(JSON.stringify([{ version: "2.5.0" }]), { status: 200 }); return new Response(JSON.stringify([{ version: "2.6.0" }]), { status: 200 });
}; };
const cliFetch = async () => { const cliFetch = async () => {
cliCalls += 1; cliCalls += 1;
@@ -186,7 +186,7 @@ test("concurrent requests coalesce within each product without crossing products
releaseIde?.(); releaseIde?.();
releaseCli?.(); releaseCli?.();
assert.deepEqual(await Promise.all([ideOne, ideTwo]), ["2.5.0", "2.5.0"]); assert.deepEqual(await Promise.all([ideOne, ideTwo]), ["2.6.0", "2.6.0"]);
assert.deepEqual(await Promise.all([cliOne, cliTwo]), ["1.4.0", "1.4.0"]); assert.deepEqual(await Promise.all([cliOne, cliTwo]), ["1.4.0", "1.4.0"]);
assert.equal(ideCalls, 1); assert.equal(ideCalls, 1);
assert.equal(cliCalls, 1); assert.equal(cliCalls, 1);