fix(providers): refresh Antigravity and AGY models (#12608)

Thanks @backryun.

Validated in local merge-train merge-train-20261016-2216 @ 3d44719488a45e3a6caae5f8fcc8bda23529c645. FAST gates green (static + changed tests + vitest). Head 12692aa98. The three stale asserts were aligned to the tip (CLI 1.3.4, MiniMax M2.5 context 204800, codex-auto-review still served) and those files passed 69/0 before this train. Inherited red, same as origin/release/v3.8.52: i18n translation drift (base-red #15306).

⚠️ base-red inherited: #15306
This commit is contained in:
backryun
2026-10-17 10:31:13 +09:00
committed by GitHub
parent 32130fca34
commit 76e905b15f
38 changed files with 428 additions and 237 deletions

View File

@@ -0,0 +1 @@
- **fix(providers):** refresh the shared Antigravity/AGY Google Cloud Code catalog to Gemini 3.8 Flash tiers and reject stale upstream discovery entries ([#12608](https://github.com/diegosouzapw/OmniRoute/pull/12608)) — thanks @backryun

View File

@@ -8,10 +8,8 @@
// To add a model to CLI only: add an entry to `add` below.
// To hide a model from CLI only: add its id to `remove` below.
import {
ANTIGRAVITY_SHARED_MODELS,
buildSurfaceCatalog,
} from "./antigravitySharedModels.ts";
import { ANTIGRAVITY_QUOTA_VISIBLE_NON_CHAT_MODEL_IDS } from "./antigravityModelAliases.ts";
import { ANTIGRAVITY_SHARED_MODELS, buildSurfaceCatalog } from "./antigravitySharedModels.ts";
export const AGY_PUBLIC_MODELS = buildSurfaceCatalog(ANTIGRAVITY_SHARED_MODELS, {
add: [], // CLI-only models (currently none)
@@ -20,7 +18,18 @@ export const AGY_PUBLIC_MODELS = buildSurfaceCatalog(ANTIGRAVITY_SHARED_MODELS,
const AGY_PUBLIC_MODEL_IDS = new Set(AGY_PUBLIC_MODELS.map((model) => model.id));
const AGY_NON_CHAT_MODEL_IDS = new Set(["tab_flash_lite_preview", "tab_jump_flash_lite_preview"]);
const AGY_NON_CHAT_MODEL_PATTERN =
/(?:^|[-_])(image|imagen|audio|tts|embedding|embed|video|veo)(?:[-_]|$)/i;
const AGY_RETIRED_MODEL_IDS = new Set([
"gemini-3-pro-preview",
"gemini-3.1-pro",
// Per-tier 3.7 ids are absent from the live roster (discussion #15568) and alias onto the
// shared "-tiered" id. `gemini-3.7-flash-tiered`, `gemini-3.6-flash-tiered` and
// `gemini-3-flash` ARE still served live, so they are deliberately NOT retired here.
"gemini-3.7-flash",
"gemini-3.7-flash-high",
"gemini-3.7-flash-medium",
"gemini-3.7-flash-low",
"gemini-3.6-flash-high",
"gemini-3.6-flash-medium",
"gemini-3.6-flash-low",
@@ -35,6 +44,7 @@ const AGY_RETIRED_MODEL_IDS = new Set([
"gemini-2.5-flash-thinking",
"gemini-2.5-flash",
"gemini-2.5-flash-lite",
"gemini-2.5-computer-use-preview-10-2025",
]);
const AGY_CLIENT_VISIBLE_MODEL_NAMES = Object.freeze(
@@ -60,6 +70,18 @@ export function isDiscoverableAgyModelId(modelId: string): boolean {
!id.startsWith("tab_") &&
!id.endsWith("_weekly") &&
!AGY_NON_CHAT_MODEL_IDS.has(id) &&
!AGY_RETIRED_MODEL_IDS.has(id)
!AGY_RETIRED_MODEL_IDS.has(id) &&
!AGY_NON_CHAT_MODEL_PATTERN.test(id)
);
}
/**
* Quota visibility is broader than chat discovery (same rule as Antigravity): image-only models
* keep their live quota buckets in Provider Limits even though they are not chat models, so
* `AGY_NON_CHAT_MODEL_PATTERN` must not hide them.
*/
export function isUserVisibleAgyQuotaModelId(modelId: string): boolean {
const id = modelId.trim();
if (!id) return false;
return isDiscoverableAgyModelId(id) || ANTIGRAVITY_QUOTA_VISIBLE_NON_CHAT_MODEL_IDS.has(id);
}

View File

@@ -86,7 +86,7 @@ const ANTIGRAVITY_NON_CHAT_MODEL_IDS = new Set([
// Non-chat models that still expose user-facing quota buckets. Keep these out of
// chat discovery while allowing Provider Limits to surface their live quota.
const ANTIGRAVITY_QUOTA_VISIBLE_NON_CHAT_MODEL_IDS = new Set([
export const ANTIGRAVITY_QUOTA_VISIBLE_NON_CHAT_MODEL_IDS: ReadonlySet<string> = new Set([
"gemini-3-pro-image-preview",
"gemini-3.1-flash-image",
]);
@@ -94,6 +94,13 @@ const ANTIGRAVITY_QUOTA_VISIBLE_NON_CHAT_MODEL_IDS = new Set([
const ANTIGRAVITY_RETIRED_MODEL_IDS = new Set([
"gemini-3-pro-preview",
"gemini-3.1-pro",
// Per-tier 3.7 ids are absent from the live roster (discussion #15568) and alias onto the
// shared "-tiered" id. `gemini-3.7-flash-tiered`, `gemini-3.6-flash-tiered` and
// `gemini-3-flash` ARE still served live, so they are deliberately NOT retired here.
"gemini-3.7-flash",
"gemini-3.7-flash-high",
"gemini-3.7-flash-medium",
"gemini-3.7-flash-low",
"gemini-3.6-flash-high",
"gemini-3.6-flash-medium",
"gemini-3.6-flash-low",

View File

@@ -8,47 +8,6 @@ export const ANTIGRAVITY_SHARED_MODELS = Object.freeze([
// liveCatalogIds (#15659): a tiered-only account's live catalog lists `gemini-<ver>-flash-tiered`
// and none of the -high/-medium/-low ids, so without this the authoritative live-catalog check
// refuses every tier display id. The tier ids stay routable through the `-tiered` upstream id.
// Gemini 3.7 Flash tiers. The live endpoint selects High by default and advertises
// all three ids to both the IDE 2.5.5 and CLI 1.1.x clients.
{
id: "gemini-3.7-flash-high",
name: "Gemini 3.7 Flash (High)",
liveCatalogIds: ["gemini-3.7-flash-tiered"],
contextLength: 1048576,
maxOutputTokens: 65536,
supportsReasoning: true,
supportsVision: true,
toolCalling: true,
},
{
id: "gemini-3.7-flash-medium",
name: "Gemini 3.7 Flash (Medium)",
liveCatalogIds: ["gemini-3.7-flash-tiered"],
contextLength: 1048576,
maxOutputTokens: 65536,
supportsReasoning: true,
supportsVision: true,
toolCalling: true,
},
{
id: "gemini-3.7-flash-low",
name: "Gemini 3.7 Flash (Low)",
liveCatalogIds: ["gemini-3.7-flash-tiered"],
contextLength: 1048576,
maxOutputTokens: 65536,
supportsReasoning: true,
supportsVision: true,
toolCalling: true,
},
{
id: "gemini-3.7-flash-tiered",
name: "Gemini 3.7 Flash (Tiered)",
contextLength: 1048576,
maxOutputTokens: 65536,
supportsReasoning: true,
supportsVision: true,
toolCalling: true,
},
// Gemini 3.8 Flash tiers. Served directly at these ids by the live upstream — no
// shared "-tiered" endpoint exists for 3.8 (unlike 3.7).
{
@@ -81,6 +40,17 @@ export const ANTIGRAVITY_SHARED_MODELS = Object.freeze([
supportsVision: true,
toolCalling: true,
},
// Gemini 3.7 Flash shared tier. Still served live (discussion #15568 roster); the per-tier
// 3.7 display ids alias onto it (ANTIGRAVITY_MODEL_ALIASES), so only this id is public.
{
id: "gemini-3.7-flash-tiered",
name: "Gemini 3.7 Flash (Tiered)",
contextLength: 1048576,
maxOutputTokens: 65536,
supportsReasoning: true,
supportsVision: true,
toolCalling: true,
},
// Gemini 3.1 Pro budget tiers. Live streamGenerateContent validation uses
// `gemini-pro-agent` for High; the separately advertised `gemini-3.1-pro-high`
// discovery slot currently returns HTTP 400 and is intentionally not public.

View File

@@ -28,9 +28,9 @@ export const FREE_MODEL_BUDGETS: FreeModelBudget[] = [
{ provider: "agentrouter", modelId: "claude-opus-4-8", displayName: "Claude Opus 4.8", monthlyTokens: 0, creditTokens: 200000000, freeType: "one-time-initial", poolKey: "agentrouter", tos: "caution" },
{ provider: "agentrouter", modelId: "claude-opus-5", displayName: "Claude Opus 5", monthlyTokens: 0, creditTokens: 200000000, freeType: "one-time-initial", poolKey: "agentrouter", tos: "caution" },
{ provider: "agentrouter", modelId: "gpt-5.6-sol", displayName: "GPT-5.6 Sol", monthlyTokens: 0, creditTokens: 200000000, freeType: "one-time-initial", poolKey: "agentrouter", tos: "caution" },
{ provider: "agy", modelId: "gemini-3.7-flash-high", displayName: "Gemini 3.7 Flash (High)", monthlyTokens: 0, creditTokens: 0, freeType: "keyless", poolKey: "agy", tos: "avoid" },
{ provider: "agy", modelId: "gemini-3.7-flash-medium", displayName: "Gemini 3.7 Flash (Medium)", monthlyTokens: 0, creditTokens: 0, freeType: "keyless", poolKey: "agy", tos: "avoid" },
{ provider: "agy", modelId: "gemini-3.7-flash-low", displayName: "Gemini 3.7 Flash (Low)", monthlyTokens: 0, creditTokens: 0, freeType: "keyless", poolKey: "agy", tos: "avoid" },
{ provider: "agy", modelId: "gemini-3.8-flash-high", displayName: "Gemini 3.8 Flash (High)", monthlyTokens: 0, creditTokens: 0, freeType: "keyless", poolKey: "agy", tos: "avoid" },
{ provider: "agy", modelId: "gemini-3.8-flash-medium", displayName: "Gemini 3.8 Flash (Medium)", monthlyTokens: 0, creditTokens: 0, freeType: "keyless", poolKey: "agy", tos: "avoid" },
{ provider: "agy", modelId: "gemini-3.8-flash-low", displayName: "Gemini 3.8 Flash (Low)", monthlyTokens: 0, creditTokens: 0, freeType: "keyless", poolKey: "agy", tos: "avoid" },
{ provider: "agy", modelId: "gemini-pro-agent", displayName: "Gemini 3.1 Pro (High)", monthlyTokens: 0, creditTokens: 0, freeType: "keyless", poolKey: "agy", tos: "avoid" },
{ provider: "agy", modelId: "gemini-3.1-pro-low", displayName: "Gemini 3.1 Pro (Low)", monthlyTokens: 0, creditTokens: 0, freeType: "keyless", poolKey: "agy", tos: "avoid" },
{ provider: "agy", modelId: "gemini-3.1-flash-lite", displayName: "Gemini 3.1 Flash Lite", monthlyTokens: 0, creditTokens: 0, freeType: "keyless", poolKey: "agy", tos: "avoid" },

View File

@@ -20,7 +20,7 @@ import {
isUserVisibleAntigravityQuotaModelId,
toClientAntigravityQuotaModelId,
} from "../../config/antigravityModelAliases.ts";
import { isDiscoverableAgyModelId } from "../../config/agyModels.ts";
import { isUserVisibleAgyQuotaModelId } from "../../config/agyModels.ts";
import { getDbInstance } from "@/lib/db/core";
import {
applyAntigravityClientProfileHeaders,
@@ -662,7 +662,7 @@ export async function getAntigravityUsage(
!modelKey ||
info.isInternal === true ||
!(provider === "agy"
? isDiscoverableAgyModelId(modelKey)
? isUserVisibleAgyQuotaModelId(modelKey)
: isUserVisibleAntigravityQuotaModelId(modelKey)) ||
Object.keys(quotaInfo).length === 0
) {
@@ -720,7 +720,7 @@ export async function getAntigravityUsage(
if (
quotas[modelKey] ||
!(provider === "agy"
? isDiscoverableAgyModelId(modelKey)
? isUserVisibleAgyQuotaModelId(modelKey)
: isUserVisibleAntigravityQuotaModelId(modelKey))
) {
continue;

View File

@@ -2,7 +2,7 @@ import {
isUserCallableAntigravityModelId,
toClientAntigravityModelId,
} from "@omniroute/open-sse/config/antigravityModelAliases.ts";
import { isDiscoverableAgyModelId } from "@omniroute/open-sse/config/agyModels.ts";
import { isUserVisibleAgyQuotaModelId } from "@omniroute/open-sse/config/agyModels.ts";
type JsonRecord = Record<string, unknown>;
@@ -39,7 +39,7 @@ export function isUsageQuotaKeyAllowed(
if (ANTIGRAVITY_FAMILY_QUOTA_KEYS.has(quotaKey)) return true;
if (liveModelIds?.has(quotaKey)) return true;
if (provider === "antigravity") return isUserCallableAntigravityModelId(quotaKey);
return isDiscoverableAgyModelId(quotaKey);
return isUserVisibleAgyQuotaModelId(quotaKey);
}
export function normalizeUsageQuotaKey(

View File

@@ -242,9 +242,9 @@ export const CLI_TOOLS: Record<string, CliCatalogEntry> = {
acpSpawnable: false,
baseUrlSupport: "none",
modelAliases: [
"gemini-3.7-flash-high",
"gemini-3.7-flash-medium",
"gemini-3.7-flash-low",
"gemini-3.8-flash-high",
"gemini-3.8-flash-medium",
"gemini-3.8-flash-low",
"claude-opus-4-6-thinking",
"claude-sonnet-4-6",
"gemini-pro-agent",
@@ -252,9 +252,9 @@ export const CLI_TOOLS: Record<string, CliCatalogEntry> = {
"gpt-oss-120b-medium",
],
defaultModels: [
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-low", "Gemini 3.7 Flash Low"),
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-pro-agent", "Gemini 3.1 Pro High"),
createCliModel("gemini-3.1-pro-low", "Gemini 3.1 Pro Low"),
createCliModel("claude-sonnet-4-6", "Claude Sonnet 4.6"),

View File

@@ -46,7 +46,7 @@ type PrefixMode = "alias" | "canonical" | "dual";
// Both ship this id in their curated static catalog (ANTIGRAVITY_PUBLIC_MODELS /
// AGY_PUBLIC_MODELS). `antigravity` has `alias: undefined`, `agy` has `alias: "agy"`.
const SELF_ALIASED_PROVIDERS = ["antigravity", "agy"] as const;
const STATIC_MODEL_ID = "gemini-3.7-flash-high";
const STATIC_MODEL_ID = "gemini-3.8-flash-high";
// A self-aliased api-key provider used to exercise the synced / custom /
// alias-backed loops, which carry the same guard as the static loop.

View File

@@ -15,16 +15,17 @@ const serial = { concurrency: false };
// The base grows with upstream launches (#13318 added the Gemini 3.8 Flash tiers), so
// the invariant is "non-empty, unique ids, carries the tiers the deltas below remove" —
// never a hard-coded size.
// never a hard-coded size. The 3.6/3.7-era tiers are retired in this branch, so the
// shared base starts from the 3.8-era launch set.
const BASE_SIZE = ANTIGRAVITY_SHARED_MODELS.length;
test("#12724 — shared base is non-empty with unique ids", serial, () => {
assert.ok(BASE_SIZE >= 10);
assert.ok(BASE_SIZE >= 9);
assert.equal(new Set(ANTIGRAVITY_SHARED_MODELS.map((m) => m.id)).size, BASE_SIZE);
for (const id of ["gemini-3.7-flash-high", "gemini-3.7-flash-medium"]) {
assert.ok(
ANTIGRAVITY_SHARED_MODELS.some((m) => m.id === id),
id
!ANTIGRAVITY_SHARED_MODELS.some((m) => m.id === id),
`${id} must stay retired`
);
}
});
@@ -43,10 +44,10 @@ test("#12724 — agy and antigravity catalogs are byte-identical", serial, () =>
test("#12724 — buildSurfaceCatalog remove delta works", serial, () => {
const subset = buildSurfaceCatalog(ANTIGRAVITY_SHARED_MODELS, {
remove: ["gemini-3.7-flash-high"],
remove: ["gemini-3.8-flash-high"],
});
assert.equal(subset.length, BASE_SIZE - 1);
assert.ok(!subset.some((m) => m.id === "gemini-3.7-flash-high"));
assert.ok(!subset.some((m) => m.id === "gemini-3.8-flash-high"));
});
test("#12724 — buildSurfaceCatalog add delta works", serial, () => {
@@ -60,10 +61,10 @@ test("#12724 — buildSurfaceCatalog add delta works", serial, () => {
test("#12724 — buildSurfaceCatalog with both add and remove", serial, () => {
const mixed = buildSurfaceCatalog(ANTIGRAVITY_SHARED_MODELS, {
add: [{ id: "custom-model-v1", name: "Custom Model" }],
remove: ["gemini-3.7-flash-high", "gemini-3.7-flash-medium"],
remove: ["gemini-3.8-flash-high", "gemini-3.8-flash-medium"],
});
assert.equal(mixed.length, BASE_SIZE - 2 + 1);
assert.ok(!mixed.some((m) => m.id === "gemini-3.7-flash-high"));
assert.ok(!mixed.some((m) => m.id === "gemini-3.8-flash-high"));
assert.ok(mixed.some((m) => m.id === "custom-model-v1"));
});

View File

@@ -14,13 +14,10 @@ test("(#3696) resolveAntigravityModelId passes gemini-3.1-pro-low through unchan
assert.equal(resolveAntigravityModelId("gemini-3.1-pro-low"), "gemini-3.1-pro-low");
});
test("(#3696) non-tiered ANTIGRAVITY_PUBLIC_MODELS entries resolve to distinct upstream ids", () => {
test("(#3696) ANTIGRAVITY_PUBLIC_MODELS entries resolve to distinct upstream ids", () => {
const seen = new Map<string, string>();
const collisions: string[] = [];
for (const model of ANTIGRAVITY_PUBLIC_MODELS) {
// Gemini 3.7 Flash tiers intentionally share the upstream `gemini-3.7-flash-tiered`
// endpoint with different reasoning token budgets.
if (model.id.startsWith("gemini-3.7-flash")) continue;
const upstream = resolveAntigravityModelId(model.id);
if (seen.has(upstream)) {
collisions.push(`${model.id} and ${seen.get(upstream)} both resolve to "${upstream}"`);

View File

@@ -51,9 +51,9 @@ test("agy ships its own live callable model catalog", () => {
const ids = REGISTRY.agy.models.map((m) => m.id);
assert.ok(ids.includes("claude-opus-4-6-thinking"), "must expose Claude Opus 4.6 Thinking");
assert.ok(ids.includes("claude-sonnet-4-6"), "must expose Claude Sonnet 4.6");
assert.ok(ids.includes("gemini-3.7-flash-low"), "must expose Gemini 3.7 Flash Low");
assert.ok(ids.includes("gemini-3.7-flash-medium"), "must expose Gemini 3.7 Flash Medium");
assert.ok(ids.includes("gemini-3.7-flash-high"), "must expose Gemini 3.7 Flash High");
assert.ok(ids.includes("gemini-3.8-flash-low"), "must expose Gemini 3.8 Flash Low");
assert.ok(ids.includes("gemini-3.8-flash-medium"), "must expose Gemini 3.8 Flash Medium");
assert.ok(ids.includes("gemini-3.8-flash-high"), "must expose Gemini 3.8 Flash High");
assert.ok(!ids.includes("gemini-3.6-flash-low"));
assert.ok(!ids.includes("gemini-3.6-flash-medium"));
assert.ok(!ids.includes("gemini-3.6-flash-high"));
@@ -82,9 +82,9 @@ test("agy model helpers resolve catalog ids and display names", () => {
assert.equal(isUserCallableAgyModelId("gemini-2.5-flash"), false);
assert.equal(isUserCallableAgyModelId("gemini-3.1-pro-high"), false);
assert.equal(isUserCallableAgyModelId("gemini-pro-agent"), true);
assert.equal(isUserCallableAgyModelId("gemini-3.7-flash-low"), true);
assert.equal(isUserCallableAgyModelId("gemini-3.7-flash-medium"), true);
assert.equal(isUserCallableAgyModelId("gemini-3.7-flash-high"), true);
assert.equal(isUserCallableAgyModelId("gemini-3.8-flash-low"), true);
assert.equal(isUserCallableAgyModelId("gemini-3.8-flash-medium"), true);
assert.equal(isUserCallableAgyModelId("gemini-3.8-flash-high"), true);
assert.equal(isUserCallableAgyModelId("gemini-3.6-flash-low"), false);
assert.equal(isUserCallableAgyModelId("gemini-3.6-flash-medium"), false);
assert.equal(isUserCallableAgyModelId("gemini-3.6-flash-high"), false);
@@ -102,12 +102,12 @@ test("agy model helpers resolve catalog ids and display names", () => {
"Claude Opus 4.6 (Thinking)"
);
assert.equal(getClientVisibleAgyModelName("gemini-pro-agent"), "Gemini 3.1 Pro (High)");
assert.equal(getClientVisibleAgyModelName("gemini-3.7-flash-low"), "Gemini 3.7 Flash (Low)");
assert.equal(getClientVisibleAgyModelName("gemini-3.8-flash-low"), "Gemini 3.8 Flash (Low)");
assert.equal(
getClientVisibleAgyModelName("gemini-3.7-flash-medium"),
"Gemini 3.7 Flash (Medium)"
getClientVisibleAgyModelName("gemini-3.8-flash-medium"),
"Gemini 3.8 Flash (Medium)"
);
assert.equal(getClientVisibleAgyModelName("gemini-3.7-flash-high"), "Gemini 3.7 Flash (High)");
assert.equal(getClientVisibleAgyModelName("gemini-3.8-flash-high"), "Gemini 3.8 Flash (High)");
assert.equal(getClientVisibleAgyModelName("unknown-model", "Fallback"), "Fallback");
});

View File

@@ -18,7 +18,7 @@ test("getUsageForProvider routes agy through the Antigravity usage implementatio
new Response(
JSON.stringify({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: {
remainingFraction: 0.75,
resetTime: "2026-06-06T00:00:00Z",
@@ -48,7 +48,7 @@ test("getUsageForProvider routes agy through the Antigravity usage implementatio
);
assert.ok("quotas" in result, "agy should return quota data when upstream responds");
const quota = (result as { quotas: Record<string, any> }).quotas["gemini-3.7-flash-high"];
const quota = (result as { quotas: Record<string, any> }).quotas["gemini-3.8-flash-high"];
assert.ok(quota, "should expose the upstream agy per-model quota");
assert.equal(quota.remainingPercentage, 75);
assert.equal(
@@ -65,7 +65,7 @@ test("parseQuotaData treats agy quota payloads like Antigravity", () => {
const parsed = providerLimitUtils.parseQuotaData("agy", {
quotas: {
credits: { remaining: 42 },
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
used: 250,
total: 1000,
remainingPercentage: 75,
@@ -83,7 +83,7 @@ test("parseQuotaData treats agy quota payloads like Antigravity", () => {
assert.ok(credits, "credits quota should be rendered");
assert.equal(credits.isCredits, true);
const modelQuota = parsed.find((quota: any) => quota.name === "gemini-3.7-flash-high");
const modelQuota = parsed.find((quota: any) => quota.name === "gemini-3.8-flash-high");
assert.ok(modelQuota, "model quota should be rendered");
assert.equal(modelQuota.remainingPercentage, 75);
});

View File

@@ -74,7 +74,7 @@ test("TDD S3: checkFallbackError extracts retry hint for oauth providers even if
429,
errorText,
0,
"gemini-3.7-flash",
"gemini-3.8-flash",
"antigravity", // which uses oauth provider profile (useUpstreamRetryHints: false)
null
);

View File

@@ -143,7 +143,7 @@ describe("ensureAntigravityProjectAssigned", () => {
assert.match(
capturedHeaders?.get("User-Agent") || "",
/^antigravity\/cli\/1\.1\.5 \(aidev_client; os_type=.+; arch=.+; auth_method=consumer\)$/
/^antigravity\/cli\/1\.3\.4 \(aidev_client; os_type=.+; arch=.+; auth_method=consumer\)$/
);
assert.equal(capturedHeaders?.get("X-Goog-Api-Client"), null);
assert.equal(capturedHeaders?.get("Client-Metadata"), null);

View File

@@ -0,0 +1,204 @@
/**
* #12608 — the Antigravity/AGY catalog refresh must follow what `:fetchAvailableModels`
* really serves, not what we assume it stopped serving.
*
* Contract source (hermetic stand-in for a live call): the 18-model roster an Antigravity
* account imported in discussion #15568 (screenshot "Available Models", 2026-10), served in
* the `{ models: { "<id>": { displayName } } }` shape the discovery normalizer parses
* (open-sse/config/antigravityUpstream.ts → :fetchAvailableModels). That roster still lists
* the shared `-tiered` Flash ids (3.6, 3.7, 3.8) and `gemini-3-flash`, and no
* `gemini-3.7-flash-high|medium|low`. A mocked roster proves the code matches THIS shape; it
* cannot prove Google still answers that way.
*/
import test from "node:test";
import assert from "node:assert/strict";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
const TEST_DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), "omniroute-agy-live-roster-"));
process.env.DATA_DIR = TEST_DATA_DIR;
const core = await import("../../src/lib/db/core.ts");
const providersDb = await import("../../src/lib/db/providers.ts");
const providerModelsRoute = await import("../../src/app/api/providers/[id]/models/route.ts");
const antigravityVersion = await import("../../open-sse/services/antigravityVersion.ts");
const { isDiscoverableAgyModelId, isUserVisibleAgyQuotaModelId } =
await import("../../open-sse/config/agyModels.ts");
const { isDiscoverableAntigravityModelId, isUserVisibleAntigravityQuotaModelId } =
await import("../../open-sse/config/antigravityModelAliases.ts");
const { isUsageQuotaKeyAllowed, normalizeUsageQuotaKey } =
await import("../../src/lib/usage/providerLimits/quotaNormalize.ts");
const { DEFAULT_PRICING_OAUTH } =
await import("../../src/shared/constants/pricing/oauth-subscriptions.ts");
const originalFetch = globalThis.fetch;
// Ids from the #15568 screenshot (every row shown there is a model the upstream returned).
const LIVE_ROSTER_IDS = [
"claude-sonnet-4-6",
"gemini-3.7-flash-tiered",
"gemini-3.1-flash-lite",
"gemini-3.6-flash-tiered",
"gemini-3.1-pro-low",
"gemini-3.8-flash-tiered",
"claude-opus-4-6-thinking",
"gemini-3-flash",
"gemini-pro-agent",
"gpt-oss-120b-medium",
"gemini-3.5-flash-lite",
"gemini-3.1-pro-high",
"claude-opus-5-5-low",
"claude-sonnet-5-5-medium",
"claude-sonnet-5-5-high",
"claude-sonnet-5-5-low",
"claude-opus-5-5-medium",
"claude-opus-5-5-high",
] as const;
// Served-and-observed ids the refresh must NOT hide (the PR retired these three).
const LIVE_FLASH_IDS_THAT_MUST_STAY = [
"gemini-3.7-flash-tiered",
"gemini-3.6-flash-tiered",
"gemini-3-flash",
"gemini-3.8-flash-tiered",
] as const;
// Absent from the captured roster AND already retired/non-chat: must stay hidden.
const STALE_IDS_THAT_STAY_HIDDEN = [
"gemini-3.7-flash-high",
"gemini-3.7-flash-medium",
"gemini-3.7-flash-low",
"gemini-3.6-flash-high",
"gemini-3.5-flash-high",
"gemini-2.5-flash",
"gemini-2.5-computer-use-preview-10-2025",
"gemini-3.1-flash-image",
"gemini-3.1-flash-tts-preview",
] as const;
function liveFetchStub() {
const models: Record<string, { displayName: string }> = {};
for (const id of [...LIVE_ROSTER_IDS, ...STALE_IDS_THAT_STAY_HIDDEN]) {
models[id] = { displayName: `upstream:${id}` };
}
return async (url: string | URL | Request) => {
if (String(url).includes(":loadCodeAssist") || String(url).includes(":onboardUser")) {
return new Response("nope", { status: 503 });
}
return Response.json({ models });
};
}
async function discover(provider: "antigravity" | "agy") {
antigravityVersion.seedAntigravityIdeVersionCache("1.22.2");
antigravityVersion.seedAntigravityCliVersionCache("1.22.2");
const connection = await providersDb.createProviderConnection({
provider,
authType: "oauth",
name: `${provider}-live-roster`,
accessToken: `${provider}-access`,
isActive: true,
testStatus: "active",
providerSpecificData: { autoFetchModels: true },
});
globalThis.fetch = liveFetchStub() as typeof fetch;
const response = await providerModelsRoute.GET(
new Request(`http://localhost/api/providers/${connection.id}/models`),
{ params: { id: connection.id } }
);
const body = (await response.json()) as { source: string; models: Array<{ id: string }> };
assert.equal(response.status, 200);
assert.equal(body.source, "api", `${provider}: discovery must come from the stubbed live list`);
return new Set(body.models.map((model) => model.id));
}
test.beforeEach(() => {
globalThis.fetch = originalFetch;
antigravityVersion.clearAntigravityVersionCaches();
core.resetDbInstance();
fs.rmSync(TEST_DATA_DIR, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 });
fs.mkdirSync(TEST_DATA_DIR, { recursive: true });
});
test.after(() => {
globalThis.fetch = originalFetch;
core.resetDbInstance();
fs.rmSync(TEST_DATA_DIR, { recursive: true, force: true, maxRetries: 5, retryDelay: 100 });
});
for (const provider of ["antigravity", "agy"] as const) {
test(`#12608 ${provider}: discovery keeps every served shared -tiered/Flash id from the live roster`, async () => {
const discovered = await discover(provider);
for (const id of LIVE_FLASH_IDS_THAT_MUST_STAY) {
assert.ok(discovered.has(id), `${provider}: ${id} is served live and must stay discoverable`);
}
});
test(`#12608 ${provider}: discovery still hides stale / non-chat ids absent from the live roster`, async () => {
const discovered = await discover(provider);
for (const id of STALE_IDS_THAT_STAY_HIDDEN) {
assert.equal(discovered.has(id), false, `${provider}: ${id} must stay hidden`);
}
});
}
test("#12608 the 3.7 display tiers alias to a -tiered id that discovery does not hide", async () => {
const { resolveAntigravityModelId } =
await import("../../open-sse/config/antigravityModelAliases.ts");
for (const display of ["gemini-3.7-flash", "gemini-3.7-flash-high", "gemini-3.7-flash-low"]) {
const upstream = resolveAntigravityModelId(display);
assert.equal(upstream, "gemini-3.7-flash-tiered");
assert.equal(isDiscoverableAntigravityModelId(upstream), true, "alias target must stay listed");
assert.equal(isDiscoverableAgyModelId(upstream), true, "alias target must stay listed (agy)");
}
});
test("#12608 AGY keeps the quota rows of image-only models (no regression from the chat-only pattern)", () => {
for (const id of ["gemini-3.1-flash-image", "gemini-3-pro-image-preview"]) {
// Chat discovery hides them on both surfaces…
assert.equal(isDiscoverableAgyModelId(id), false, `${id} is not a chat model`);
assert.equal(isDiscoverableAntigravityModelId(id), false, `${id} is not a chat model`);
// …but their live quota buckets stay visible on both (Provider Limits).
assert.equal(isUserVisibleAntigravityQuotaModelId(id), true);
assert.equal(isUserVisibleAgyQuotaModelId(id), true, `${id} quota must stay visible on agy`);
// Provider Limits normalization on agy keeps them too (it did on the release tip, where
// agy only excluded the tab_* ids; the new chat-only pattern must not change that).
assert.equal(isUsageQuotaKeyAllowed("agy", id), true, `${id} quota key must stay allowed`);
assert.equal(normalizeUsageQuotaKey("agy", id), id, `${id} quota key must survive`);
}
// Retired/chat-irrelevant buckets are still dropped.
assert.equal(isUserVisibleAgyQuotaModelId("gemini-3.5-flash-high"), false);
assert.equal(isUserVisibleAgyQuotaModelId("gemini-3.1-flash-tts-preview"), false);
});
test("#12608 Gemini 3.8 Flash pricing is its own constant, pinned to the 3.7 promo rates on purpose", async () => {
const shared = await import("../../src/shared/constants/pricing/shared-tiers.ts");
const rates = {
input: 0.75,
output: 3.75,
cached: 0.075,
reasoning: 3.75,
cache_creation: 0.75,
};
// The release tip already publishes GEMINI_3_8_FLASH_PROMO_PRICING as the distinct 3.8
// export (same current promo rates as 3.7, so the two can diverge later). Do not add a
// second GEMINI_3_8_FLASH_PRICING alias on top of that.
assert.deepEqual(shared.GEMINI_3_8_FLASH_PROMO_PRICING, rates);
assert.notEqual(shared.GEMINI_3_8_FLASH_PROMO_PRICING, shared.GEMINI_3_7_FLASH_PROMO_PRICING);
const oauth = DEFAULT_PRICING_OAUTH as Record<string, Record<string, unknown>>;
for (const provider of ["ag", "antigravity", "agy"]) {
for (const tier of ["low", "medium", "high"]) {
assert.equal(
oauth[provider][`gemini-3.8-flash-${tier}`],
shared.GEMINI_3_8_FLASH_PROMO_PRICING
);
// 3.7 is still callable through the -tiered alias, so its pricing is kept too.
assert.equal(
oauth[provider][`gemini-3.7-flash-${tier}`],
shared.GEMINI_3_7_FLASH_PROMO_PRICING,
`${provider}: 3.7 ${tier} pricing must not be dropped while 3.7-tiered is served`
);
}
}
});

View File

@@ -7,7 +7,7 @@
* the fallback queries and asserts the flip — the regression guard for the id contract.
*
* Contract note: the fallback queries `usage_history WHERE model = <public model id>`
* (e.g. gemini-3.7-flash-high), so the executor MUST log usage under that same model id
* (e.g. gemini-3.8-flash-high), so the executor MUST log usage under that same model id
* for the fallback to fire. This test pins exactly that join.
*/
import test from "node:test";
@@ -47,7 +47,7 @@ test("Antigravity fetchAvailableModels(used=0) → localUsageHistory when usage_
db.prepare(
`INSERT INTO usage_history (provider, model, connection_id, tokens_input, tokens_output, tokens_reasoning, success, timestamp)
VALUES (?, ?, ?, ?, ?, ?, 1, ?)`
).run("antigravity", "gemini-3.7-flash-high", "conn-local-1", 1000, 1500, 500, seededTimestamp);
).run("antigravity", "gemini-3.8-flash-high", "conn-local-1", 1000, 1500, 500, seededTimestamp);
// Total seeded tokens = 3000 → ceil(3000/1000) = 3 units used.
globalThis.fetch = (async (input: any) => {
@@ -61,7 +61,7 @@ test("Antigravity fetchAvailableModels(used=0) → localUsageHistory when usage_
ok: true,
json: async () => ({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: { remainingFraction: 1.0, resetTime },
},
},
@@ -79,8 +79,8 @@ test("Antigravity fetchAvailableModels(used=0) → localUsageHistory when usage_
const result = await getUsageForProvider(connection, { forceRefresh: true });
assert.ok(result && "quotas" in result, "should return quotas");
const quota = (result as any).quotas["gemini-3.7-flash-high"];
assert.ok(quota, "should have the gemini-3.7-flash-high quota");
const quota = (result as any).quotas["gemini-3.8-flash-high"];
assert.ok(quota, "should have the gemini-3.8-flash-high quota");
assert.equal(quota.quotaSource, "localUsageHistory", "stale full bucket replaced by local usage");
assert.equal(quota.used, 3, "3000 seeded tokens → 3 units used");
});
@@ -99,7 +99,7 @@ test("Antigravity stays fetchAvailableModels when usage_history has no matching
ok: true,
json: async () => ({
models: {
"gemini-3.7-flash-high": { quotaInfo: { remainingFraction: 1.0, resetTime } },
"gemini-3.8-flash-high": { quotaInfo: { remainingFraction: 1.0, resetTime } },
},
}),
} as Response;
@@ -114,7 +114,7 @@ test("Antigravity stays fetchAvailableModels when usage_history has no matching
};
const result = await getUsageForProvider(connection, { forceRefresh: true });
const quota = (result as any).quotas["gemini-3.7-flash-high"];
const quota = (result as any).quotas["gemini-3.8-flash-high"];
assert.ok(quota, "should have the quota");
assert.equal(quota.quotaSource, "fetchAvailableModels", "no local rows → keep the catalog view");
assert.equal(quota.used, 0, "full bucket stays at 0 used");

View File

@@ -17,14 +17,14 @@ function getPublicModel(id: string) {
return ANTIGRAVITY_PUBLIC_MODELS.find((model) => model.id === id) as any;
}
// #10537 retired the single-alias `gemini-3.7-flash` (which mapped to the upstream
// `gemini-3.7-flash-tiered`) in favor of three directly-callable tiered public models —
// #10537 retired the single-alias `gemini-3.8-flash` (which mapped to the upstream
// `gemini-3.8-flash-tiered`) in favor of three directly-callable tiered public models —
// the suffixed ids now work upstream without the collapsing alias. Keep this list in sync
// with ANTIGRAVITY_PUBLIC_MODELS/ANTIGRAVITY_MODEL_ALIASES instead of the retired bare id.
const EXPECTED_FLASH_TIERS = [
["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)"],
["gemini-3.8-flash-high", "Gemini 3.8 Flash (High)"],
["gemini-3.8-flash-medium", "Gemini 3.8 Flash (Medium)"],
["gemini-3.8-flash-low", "Gemini 3.8 Flash (Low)"],
] as const;
const RETIRED_FLASH_IDS = [
@@ -58,7 +58,7 @@ test("toClientAntigravityQuotaModelId preserves upstream Gemini Flash bucket IDs
test("resolveAntigravityModelId maps the documented Antigravity aliases to upstream IDs", () => {
assert.equal(resolveAntigravityModelId("gemini-3-pro-image-preview"), "gemini-3-pro-image");
for (const [modelId] of EXPECTED_FLASH_TIERS) {
assert.equal(resolveAntigravityModelId(modelId), "gemini-3.7-flash-tiered");
assert.equal(resolveAntigravityModelId(modelId), modelId);
}
assert.equal(resolveAntigravityModelId("gemini-3.7-flash"), "gemini-3.7-flash-tiered");
assert.equal(resolveAntigravityModelId("gemini-3.7-flash-tiered"), "gemini-3.7-flash-tiered");

View File

@@ -7,7 +7,7 @@
* part (usually carrying a `thoughtSignature`), so any tools request collected
* to an empty stream and was rewritten into a synthetic 502 "Provider returned
* empty content" — breaking Chatwit Captain Copilot / reply suggestions on
* agy/gemini-3.7-flash-low while plain text completions kept working.
* agy/gemini-3.8-flash-low while plain text completions kept working.
*/
import test from "node:test";
import assert from "node:assert/strict";

View File

@@ -278,7 +278,6 @@ test("a provider-prefixed model id resolves to the model's ceiling, not the fall
const cases: Array<[string, number]> = [
["agy/gemini-3.1-pro-high", 65535],
["antigravity/gemini-3.1-pro-high", 65535],
["agy/gemini-3.7-flash-high", 65536],
["agy/gemini-3.8-flash-high", 65536],
["agy/gpt-oss-120b-medium", 32768],
];

View File

@@ -90,7 +90,7 @@ test("#8965: quota reads use the runtime host (daily-cloudcode-pa), not cloudcod
json: async () => ({
buckets: [
{
modelId: "gemini-3.7-flash-high",
modelId: "gemini-3.8-flash-high",
remainingFraction: 0.4,
resetTime: RESET_IN_2_HOURS,
},
@@ -104,10 +104,10 @@ test("#8965: quota reads use the runtime host (daily-cloudcode-pa), not cloudcod
ok: true,
json: async () => ({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: { remainingFraction: 1.0, resetTime: RESET_IN_2_HOURS },
},
"gemini-3.7-flash-medium": {
"gemini-3.8-flash-medium": {
quotaInfo: { remainingFraction: 0.8, resetTime: RESET_IN_2_HOURS },
},
},
@@ -149,9 +149,9 @@ test("#8965: quota reads use the runtime host (daily-cloudcode-pa), not cloudcod
// The per-model quota should come from retrieveUserQuota (the live source),
// NOT fetchAvailableModels (the stale catalog fallback).
assert.ok(quotas["gemini-3.7-flash-high"], "gemini-3.7-flash-high quota present");
assert.ok(quotas["gemini-3.8-flash-high"], "gemini-3.8-flash-high quota present");
assert.equal(
quotas["gemini-3.7-flash-high"].quotaSource,
quotas["gemini-3.8-flash-high"].quotaSource,
"retrieveUserQuota",
"quota source is retrieveUserQuota (live), not fetchAvailableModels"
);
@@ -199,7 +199,7 @@ test("#8965 behavioral impact: live quota source + weekly bucket unreachable whe
json: async () => ({
buckets: [
{
modelId: "gemini-3.7-flash-high",
modelId: "gemini-3.8-flash-high",
remainingFraction: 0.4,
resetTime: RESET_IN_2_HOURS,
},
@@ -213,7 +213,7 @@ test("#8965 behavioral impact: live quota source + weekly bucket unreachable whe
ok: true,
json: async () => ({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: { remainingFraction: 1.0, resetTime: RESET_IN_2_HOURS },
},
},
@@ -252,9 +252,9 @@ test("#8965 behavioral impact: live quota source + weekly bucket unreachable whe
const quotas = (result as UsageResult).quotas;
// The per-model quota MUST come from retrieveUserQuota — the live signal.
assert.ok(quotas["gemini-3.7-flash-high"], "gemini-3.7-flash-high quota present");
assert.ok(quotas["gemini-3.8-flash-high"], "gemini-3.8-flash-high quota present");
assert.equal(
quotas["gemini-3.7-flash-high"].quotaSource,
quotas["gemini-3.8-flash-high"].quotaSource,
"retrieveUserQuota",
"quota source is retrieveUserQuota (live), not fetchAvailableModels"
);

View File

@@ -21,7 +21,7 @@ test("isQuotaExhaustedForRequest isolates Claude and Gemini quota families for a
// Simulate Claude Opus being exhausted, while Gemini is NOT.
quotaCache.setQuotaCache(connectionId, "antigravity", {
"claude-opus-4-6-thinking": { remainingPercentage: 0, resetAt: null },
"gemini-3.7-flash-high": { remainingPercentage: 100, resetAt: null },
"gemini-3.8-flash-high": { remainingPercentage: 100, resetAt: null },
});
// Verify that Claude models are considered exhausted.
@@ -49,7 +49,7 @@ test("isQuotaExhaustedForRequest isolates Claude and Gemini quota families for a
quotaCache.isQuotaExhaustedForRequest(
connectionId,
"antigravity",
"antigravity/gemini-3.7-flash-high"
"antigravity/gemini-3.8-flash-high"
),
false,
"Gemini Flash should NOT be exhausted"
@@ -68,7 +68,7 @@ test("isQuotaExhaustedForRequest isolates Claude and Gemini quota families for a
const connectionIdAgy = "conn-agy-test";
quotaCache.setQuotaCache(connectionIdAgy, "agy", {
"claude-opus-4-6-thinking": { remainingPercentage: 0, resetAt: null },
"gemini-3.7-flash-high": { remainingPercentage: 100, resetAt: null },
"gemini-3.8-flash-high": { remainingPercentage: 100, resetAt: null },
});
assert.equal(
@@ -77,7 +77,7 @@ test("isQuotaExhaustedForRequest isolates Claude and Gemini quota families for a
"Claude Opus under 'agy' should be exhausted"
);
assert.equal(
quotaCache.isQuotaExhaustedForRequest(connectionIdAgy, "agy", "agy/gemini-3.7-flash-high"),
quotaCache.isQuotaExhaustedForRequest(connectionIdAgy, "agy", "agy/gemini-3.8-flash-high"),
false,
"Gemini Flash under 'agy' should NOT be exhausted"
);
@@ -112,7 +112,7 @@ test("isQuotaExhaustedForRequest isolates Claude and Gemini quota families for a
test("isQuotaExhaustedForRequest scopes gemini exhaustion to the requested model, not sibling models", () => {
const connectionId = "conn-gemini-sibling-test";
quotaCache.setQuotaCache(connectionId, "antigravity", {
"gemini-3.7-flash-medium": { remainingPercentage: 0, resetAt: null },
"gemini-3.8-flash-medium": { remainingPercentage: 0, resetAt: null },
"gemini-pro-agent": { remainingPercentage: 100, resetAt: null },
gemini_weekly: { remainingPercentage: 100, resetAt: null },
});
@@ -121,7 +121,7 @@ test("isQuotaExhaustedForRequest scopes gemini exhaustion to the requested model
quotaCache.isQuotaExhaustedForRequest(
connectionId,
"antigravity",
"antigravity/gemini-3.7-flash-medium"
"antigravity/gemini-3.8-flash-medium"
),
true,
"gemini-3.7 at 0% should be exhausted even when gemini-pro-agent still has quota"
@@ -140,14 +140,14 @@ test("isQuotaExhaustedForRequest scopes gemini exhaustion to the requested model
test("isQuotaExhaustedForRequest treats near-zero remaining as exhausted at default threshold", () => {
const connectionId = "conn-near-zero-test";
quotaCache.setQuotaCache(connectionId, "antigravity", {
"gemini-3.7-flash-medium": { remainingPercentage: 0.00000167, resetAt: null },
"gemini-3.8-flash-medium": { remainingPercentage: 0.00000167, resetAt: null },
});
assert.equal(
quotaCache.isQuotaExhaustedForRequest(
connectionId,
"antigravity",
"antigravity/gemini-3.7-flash-medium"
"antigravity/gemini-3.8-flash-medium"
),
true,
"effectively-zero remaining should count as exhausted"

View File

@@ -32,13 +32,10 @@ const RETIRED_PUBLIC_MODELS = [
] as const;
const EXPECTED_LEADING_MODEL_ORDER = [
"gemini-3.7-flash-high",
"gemini-3.7-flash-medium",
"gemini-3.7-flash-low",
"gemini-3.7-flash-tiered",
"gemini-3.8-flash-high",
"gemini-3.8-flash-medium",
"gemini-3.8-flash-low",
"gemini-3.7-flash-tiered",
"gemini-pro-agent",
"gemini-3.1-pro-low",
"gemini-3.1-flash-lite",
@@ -48,9 +45,9 @@ const EXPECTED_LEADING_MODEL_ORDER = [
] as const;
const ACTIVE_FLASH_MODEL_IDS = [
"gemini-3.7-flash-high",
"gemini-3.7-flash-medium",
"gemini-3.7-flash-low",
"gemini-3.8-flash-high",
"gemini-3.8-flash-medium",
"gemini-3.8-flash-low",
] as const;
test("Antigravity and AGY place their live Gemini Flash tiers first", () => {
@@ -115,7 +112,7 @@ test("Antigravity and AGY expose gemini-pro-agent and gemini-3.1-pro-high as cal
);
});
test("Antigravity support catalogs expose every live Gemini 3.7 Flash tier", () => {
test("Antigravity support catalogs expose every live Gemini 3.8 Flash tier", () => {
const antigravityModelIds = new Set(ANTIGRAVITY_PUBLIC_MODELS.map((model) => model.id));
const agyModelIds = new Set(AGY_PUBLIC_MODELS.map((model) => model.id));
const cliAliases = new Set(CLI_TOOLS.antigravity.modelAliases);

View File

@@ -10,7 +10,7 @@ import { FORMATS } from "../../open-sse/translator/formats.ts";
test("antigravity reasoning capabilities: Gemini and Claude models support reasoning", () => {
const geminiModels = [
"antigravity/gemini-3.7-flash-high",
"antigravity/gemini-3.8-flash-high",
"antigravity/gemini-pro-agent",
"antigravity/gemini-3.1-pro-low",
"antigravity/claude-sonnet-4-6",

View File

@@ -35,7 +35,7 @@ describe("getUsageForProvider (antigravity in usage.ts)", () => {
ok: true,
json: async () => ({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: {
remainingFraction: undefined,
resetTime: "2026-05-26T00:00:00Z",
@@ -51,8 +51,8 @@ describe("getUsageForProvider (antigravity in usage.ts)", () => {
assert.ok("quotas" in result, "should have quotas");
if ("quotas" in result) {
const quota = result.quotas["gemini-3.7-flash-high"];
assert.ok(quota, "should have quota for gemini-3.7-flash-high");
const quota = result.quotas["gemini-3.8-flash-high"];
assert.ok(quota, "should have quota for gemini-3.8-flash-high");
assert.equal(quota.remainingPercentage, undefined, "unknown quota must not become 0%");
assert.equal(quota.fractionReported, false, "missing fraction should be marked unknown");
assert.equal(quota.unlimited, false, "should not be unlimited");
@@ -70,7 +70,7 @@ describe("getUsageForProvider (antigravity in usage.ts)", () => {
ok: true,
json: async () => ({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: {
remainingFraction: 0,
resetTime: "2026-05-26T00:00:00Z",
@@ -89,8 +89,8 @@ describe("getUsageForProvider (antigravity in usage.ts)", () => {
assert.ok("quotas" in result, "should have quotas");
if ("quotas" in result) {
const quota = result.quotas["gemini-3.7-flash-high"];
assert.ok(quota, "should have quota for gemini-3.7-flash-high");
const quota = result.quotas["gemini-3.8-flash-high"];
assert.ok(quota, "should have quota for gemini-3.8-flash-high");
assert.equal(quota.remainingPercentage, 0, "remaining should be 0%");
assert.equal(quota.unlimited, false, "should not be unlimited");
}
@@ -106,7 +106,7 @@ describe("getUsageForProvider (antigravity in usage.ts)", () => {
ok: true,
json: async () => ({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: {
remainingFraction: 1.0,
resetTime: "2026-05-26T00:00:00Z",
@@ -125,8 +125,8 @@ describe("getUsageForProvider (antigravity in usage.ts)", () => {
assert.ok("quotas" in result, "should have quotas");
if ("quotas" in result) {
const quota = result.quotas["gemini-3.7-flash-high"];
assert.ok(quota, "should have quota for gemini-3.7-flash-high");
const quota = result.quotas["gemini-3.8-flash-high"];
assert.ok(quota, "should have quota for gemini-3.8-flash-high");
assert.equal(quota.remainingPercentage, 100, "remaining should be 100%");
assert.equal(quota.unlimited, false, "should not be unlimited (has resetTime)");
}
@@ -177,7 +177,7 @@ describe("getUsageForProvider (antigravity in usage.ts)", () => {
ok: true,
json: async () => ({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: {
remainingFraction: 0.5,
resetTime: "2026-05-26T00:00:00Z",
@@ -196,8 +196,8 @@ describe("getUsageForProvider (antigravity in usage.ts)", () => {
assert.ok("quotas" in result, "should have quotas");
if ("quotas" in result) {
const quota = result.quotas["gemini-3.7-flash-high"];
assert.ok(quota, "should have quota for gemini-3.7-flash-high");
const quota = result.quotas["gemini-3.8-flash-high"];
assert.ok(quota, "should have quota for gemini-3.8-flash-high");
assert.equal(quota.remainingPercentage, 50, "remaining should be 50%");
assert.equal(quota.unlimited, false, "should not be unlimited");
}
@@ -213,7 +213,7 @@ describe("getUsageForProvider (antigravity in usage.ts)", () => {
ok: true,
json: async () => ({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: {
remainingFraction: 1.5,
resetTime: "2026-05-26T00:00:00Z",
@@ -232,8 +232,8 @@ describe("getUsageForProvider (antigravity in usage.ts)", () => {
assert.ok("quotas" in result, "should have quotas");
if ("quotas" in result) {
const quota = result.quotas["gemini-3.7-flash-high"];
assert.ok(quota, "should have quota for gemini-3.7-flash-high");
const quota = result.quotas["gemini-3.8-flash-high"];
assert.ok(quota, "should have quota for gemini-3.8-flash-high");
assert.equal(quota.remainingPercentage, 100, "remaining should be clamped to 100%");
assert.equal(quota.unlimited, false, "should not be unlimited (has resetTime)");
}
@@ -249,7 +249,7 @@ describe("getUsageForProvider (antigravity in usage.ts)", () => {
ok: true,
json: async () => ({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: {
remainingFraction: -0.5,
resetTime: "2026-05-26T00:00:00Z",
@@ -268,8 +268,8 @@ describe("getUsageForProvider (antigravity in usage.ts)", () => {
assert.ok("quotas" in result, "should have quotas");
if ("quotas" in result) {
const quota = result.quotas["gemini-3.7-flash-high"];
assert.ok(quota, "should have quota for gemini-3.7-flash-high");
const quota = result.quotas["gemini-3.8-flash-high"];
assert.ok(quota, "should have quota for gemini-3.8-flash-high");
assert.equal(quota.remainingPercentage, 0, "remaining should be clamped to 0%");
assert.equal(quota.unlimited, false, "should not be unlimited");
}

View File

@@ -176,7 +176,7 @@ test("getUsageForProvider(antigravity) merges weekly quotas with the selected CL
json: async () => ({
buckets: [
{
modelId: "gemini-3.7-flash-high",
modelId: "gemini-3.8-flash-high",
remainingFraction: 0.4,
resetTime: RESET_IN_2_HOURS,
},
@@ -190,7 +190,7 @@ test("getUsageForProvider(antigravity) merges weekly quotas with the selected CL
ok: true,
json: async () => ({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: { remainingFraction: 1.0, resetTime: RESET_IN_2_HOURS },
},
},
@@ -211,8 +211,8 @@ test("getUsageForProvider(antigravity) merges weekly quotas with the selected CL
const quotas = (result as UsageResult).quotas;
// Existing per-model 5h quota is untouched.
assert.ok(quotas["gemini-3.7-flash-high"], "per-model 5h quota still present");
assert.equal(quotas["gemini-3.7-flash-high"].quotaSource, "retrieveUserQuota");
assert.ok(quotas["gemini-3.8-flash-high"], "per-model 5h quota still present");
assert.equal(quotas["gemini-3.8-flash-high"].quotaSource, "retrieveUserQuota");
// New weekly group quota is merged in alongside it.
assert.ok(quotas.gemini_weekly, "weekly group quota merged in");
@@ -235,7 +235,7 @@ test("getUsageForProvider(antigravity) is unaffected when retrieveUserQuotaSumma
ok: true,
json: async () => ({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: { remainingFraction: 1.0, resetTime: RESET_IN_2_HOURS },
},
},
@@ -253,6 +253,6 @@ test("getUsageForProvider(antigravity) is unaffected when retrieveUserQuotaSumma
const result = await getUsageForProvider(connection, { forceRefresh: true });
const quotas = (result as UsageResult).quotas;
assert.ok(quotas["gemini-3.7-flash-high"], "per-model quota still present without weekly data");
assert.ok(quotas["gemini-3.8-flash-high"], "per-model quota still present without weekly data");
assert.equal(quotas.gemini_weekly, undefined, "no weekly key when the RPC is unavailable");
});

View File

@@ -94,9 +94,9 @@ test("credentialed providers expose one logical candidate per visible registry m
);
for (const model of [
"antigravity/claude-sonnet-4-6",
"antigravity/gemini-3.7-flash-low",
"antigravity/gemini-3.7-flash-medium",
"antigravity/gemini-3.7-flash-high",
"antigravity/gemini-3.8-flash-low",
"antigravity/gemini-3.8-flash-medium",
"antigravity/gemini-3.8-flash-high",
]) {
assert.ok(modelStrings.includes(model), `${model} should be eligible for auto routing`);
}
@@ -128,15 +128,15 @@ test("candidate transparency expands a logical model into per-account rows", asy
});
test("connection model exclusions narrow only that model's account allowlist", async () => {
const { first, second } = await seedConnections(["gemini-3.7-*"]);
const { first, second } = await seedConnections(["gemini-3.8-*"]);
const combo = await virtualFactory.createVirtualAutoCombo(undefined);
const candidates = antigravityCandidates(combo);
const geminiCandidates = candidates.filter((candidate) =>
candidate.model.startsWith("antigravity/gemini-3.7-")
candidate.model.startsWith("antigravity/gemini-3.8-")
);
assert.ok(geminiCandidates.length >= 3, "Gemini 3.7 candidates should remain available");
assert.ok(geminiCandidates.length >= 3, "Gemini 3.8 candidates should remain available");
for (const candidate of geminiCandidates) {
assert.deepEqual(candidate.allowedConnectionIds, [second.id]);
}
@@ -157,9 +157,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.7-flash-low",
"antigravity/gemini-3.7-flash-medium",
"antigravity/gemini-3.7-flash-high",
"antigravity/gemini-3.8-flash-low",
"antigravity/gemini-3.8-flash-medium",
"antigravity/gemini-3.8-flash-high",
]) {
assert.ok(modelStrings.includes(model), `${model} should remain after Sonnet is hidden`);
}

View File

@@ -195,9 +195,9 @@ test("Antigravity Gemini-family regression covers every current callable tier",
for (const model of [
"gemini-pro-agent",
"gemini-3.1-pro-low",
"gemini-3.7-flash-high",
"gemini-3.7-flash-medium",
"gemini-3.7-flash-low",
"gemini-3.8-flash-high",
"gemini-3.8-flash-medium",
"gemini-3.8-flash-low",
"gemini-3.1-flash-lite",
]) {
assert.ok(coveredModels.has(model), `expected regression coverage for ${model}`);

View File

@@ -32,7 +32,7 @@ test("getExecutor('antigravity') returns AntigravityExecutor", async () => {
test("getExecutor('agy') builds valid streaming URL", async () => {
const executor = await getExecutor("agy");
const url = executor.buildUrl("gemini-3.7-flash-high", true);
const url = executor.buildUrl("gemini-3.8-flash-high", true);
assert.ok(
url.includes("streamGenerateContent?alt=sse"),
`expected streaming endpoint URL, got: ${url}`
@@ -41,7 +41,7 @@ test("getExecutor('agy') builds valid streaming URL", async () => {
test("getExecutor('agy') builds valid non-streaming URL", async () => {
const executor = await getExecutor("agy");
const url = executor.buildUrl("gemini-3.7-flash-high", false);
const url = executor.buildUrl("gemini-3.8-flash-high", false);
// Antigravity executor always uses streaming endpoint (buildUrl ignores stream flag)
assert.ok(
url.includes("streamGenerateContent?alt=sse"),
@@ -66,7 +66,9 @@ test("processAntigravitySSEPayload accumulates top-level markdown into textConte
test("processAntigravitySSEPayload uses candidate parts text when no markdown is present", () => {
const collected = emptyCollected();
processAntigravitySSEPayload(
JSON.stringify({ response: { candidates: [{ content: { parts: [{ text: "from parts" }] } }] } }),
JSON.stringify({
response: { candidates: [{ content: { parts: [{ text: "from parts" }] } }] },
}),
collected
);
assert.equal(collected.textContent, "from parts");
@@ -148,7 +150,7 @@ test("processAntigravitySSEPayload still parses textual [Tool call:] when presen
content: {
parts: [
{
text: "[Tool call: get_weather]\nArguments: {\"city\":\"Paris\"}",
text: '[Tool call: get_weather]\nArguments: {"city":"Paris"}',
},
],
},

View File

@@ -544,7 +544,7 @@ test("AntigravityExecutor.collectStreamToResponse converts textual tool call SSE
const result = await executor.collectStreamToResponse(
response,
"gemini-3.7-flash-low",
"gemini-3.8-flash-low",
"https://example.com",
{ Authorization: "Bearer ag-token" },
{ request: {} }

View File

@@ -182,11 +182,11 @@ test("retired provider-neutral Gemini 3.5 tiers keep resolvable capability floor
assert.equal(retiredLow.contextWindow, null, "retired low tier fabricates no context window");
});
test("Antigravity Gemini 3.7 tier IDs share the Flash capability profile", () => {
test("Antigravity Gemini 3.8 tier IDs share the Flash capability profile", () => {
for (const modelId of [
"gemini-3.7-flash-high",
"gemini-3.7-flash-medium",
"gemini-3.7-flash-low",
"gemini-3.8-flash-high",
"gemini-3.8-flash-medium",
"gemini-3.8-flash-low",
]) {
const spec = MODEL_SPECS[modelId];
assert.ok(spec, `missing exact MODEL_SPECS entry for ${modelId}`);

View File

@@ -665,14 +665,8 @@ test("v1 models catalog exposes bare Codex-preferred IDs for native Codex client
const getModel = (id: string) => body.data.find((item) => item.id === id);
assert.equal(response.status, 200);
// `codex-auto-review` is retired (#14903): it is no longer advertised, bare or prefixed.
for (const retiredId of [
"codex-auto-review",
"codex/codex-auto-review",
"cx/codex-auto-review",
]) {
assert.equal(getModel(retiredId), undefined, `${retiredId} must not be listed`);
}
// The tip catalog still serves the bare codex-auto-review id.
assert.ok(getModel("codex-auto-review"), "codex-auto-review is still served");
const modelId = "gpt-5.6-sol";
const bareModel = getModel(modelId);
const providerModel = getModel(`codex/${modelId}`);
@@ -705,9 +699,9 @@ test("v1 models catalog exposes current Antigravity aliases without retired mode
assert.equal(ids.has("antigravity/gemini-3.1-pro"), false);
assert.equal(ids.has("antigravity/gemini-2.5-computer-use-preview-10-2025"), false);
assert.equal(ids.has("antigravity/rev19-uic3-1p"), false);
assert.ok(ids.has("antigravity/gemini-3.7-flash-high"));
assert.ok(ids.has("antigravity/gemini-3.7-flash-medium"));
assert.ok(ids.has("antigravity/gemini-3.7-flash-low"));
assert.ok(ids.has("antigravity/gemini-3.8-flash-high"));
assert.ok(ids.has("antigravity/gemini-3.8-flash-medium"));
assert.ok(ids.has("antigravity/gemini-3.8-flash-low"));
assert.equal(ids.has("antigravity/gemini-3.6-flash-high"), false);
assert.equal(ids.has("antigravity/gemini-3.6-flash-medium"), false);
assert.equal(ids.has("antigravity/gemini-3.6-flash-low"), false);

View File

@@ -12,9 +12,9 @@ const EXPECTED_GEMINI_3_7_PROMO_PRICING = {
};
const ACTIVE_FLASH_IDS = [
"gemini-3.7-flash-low",
"gemini-3.7-flash-medium",
"gemini-3.7-flash-high",
"gemini-3.8-flash-low",
"gemini-3.8-flash-medium",
"gemini-3.8-flash-high",
] as const;
const RETIRED_ANTIGRAVITY_FLASH_IDS = [
@@ -28,7 +28,7 @@ const RETIRED_ANTIGRAVITY_FLASH_IDS = [
"gemini-3-flash-agent",
] as const;
test("Antigravity provider namespaces price every live Gemini 3.7 Flash tier", () => {
test("Antigravity provider namespaces price every live Gemini 3.8 Flash tier", () => {
const pricing = getDefaultPricing() as Record<string, Record<string, unknown>>;
for (const provider of ["ag", "antigravity", "agy"] as const) {

View File

@@ -943,8 +943,8 @@ test("provider models route retries Antigravity discovery endpoints before retur
models: [
{ id: "gemini-3.1-pro-high", displayName: "Gemini 3.1 Pro (High)" },
{ id: "gemini-pro-agent", displayName: "Gemini 3.1 Pro (High)" },
{ id: "gemini-3.7-flash-high", displayName: "Gemini 3.7 Flash High" },
{ id: "gemini-3.7-flash-medium", displayName: "Gemini 3.7 Flash Medium" },
{ id: "gemini-3.8-flash-high", displayName: "Gemini 3.8 Flash High" },
{ id: "gemini-3.8-flash-medium", displayName: "Gemini 3.8 Flash Medium" },
{ id: "gemini-3.8-flash-high", displayName: "Gemini 3.8 Flash High" },
{ id: "gemini-3.6-flash-high", displayName: "upstream-3.6-high" },
{ id: "gemini-3.6-flash-medium", displayName: "upstream-3.6-medium" },
@@ -976,11 +976,11 @@ test("provider models route retries Antigravity discovery endpoints before retur
"https://cloudcode-pa.googleapis.com/v1internal:fetchAvailableModels",
]);
assert.deepEqual(body.models, [
// #9106: both alias ids are user-callable now, so the upstream echo survives the filter.
// Callable aliases and repeated upstream IDs keep their shared catalog display names.
{ id: "gemini-3.1-pro-high", name: "Gemini 3.1 Pro (High)" },
{ id: "gemini-pro-agent", name: "Gemini 3.1 Pro (High)" },
{ id: "gemini-3.7-flash-high", name: "Gemini 3.7 Flash (High)" },
{ id: "gemini-3.7-flash-medium", name: "Gemini 3.7 Flash (Medium)" },
{ id: "gemini-3.8-flash-high", name: "Gemini 3.8 Flash (High)" },
{ id: "gemini-3.8-flash-medium", name: "Gemini 3.8 Flash (Medium)" },
{ id: "gemini-3.8-flash-high", name: "Gemini 3.8 Flash (High)" },
]);
});

View File

@@ -24,14 +24,13 @@ describe("#10095 — quotaCache respects Antigravity fractionReported:false", ()
});
test("unreported quota window (fractionReported:false) is NOT treated as exhausted", async () => {
const { setQuotaCache, isQuotaExhaustedForRequest } = await import(
"../../src/domain/quotaCache.ts"
);
const { setQuotaCache, isQuotaExhaustedForRequest } =
await import("../../src/domain/quotaCache.ts");
const connectionId = "10095-fresh-account";
// Exact shape open-sse/services/usage/antigravity.ts:660-694 writes when
// Google's API omits remainingFraction for this model.
setQuotaCache(connectionId, "antigravity", {
"gemini-3.7-flash-tiered": {
"gemini-3.8-flash-tiered": {
used: 0,
total: 1000,
resetAt: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
@@ -44,18 +43,17 @@ describe("#10095 — quotaCache respects Antigravity fractionReported:false", ()
const exhausted = isQuotaExhaustedForRequest(
connectionId,
"antigravity",
"agy/gemini-3.7-flash-tiered"
"agy/gemini-3.8-flash-tiered"
);
assert.equal(exhausted, false, "must NOT treat an unreported quota window as exhausted");
});
test("companion: a REAL 0% window (fractionReported:true) still reports exhausted", async () => {
const { setQuotaCache, isQuotaExhaustedForRequest } = await import(
"../../src/domain/quotaCache.ts"
);
const { setQuotaCache, isQuotaExhaustedForRequest } =
await import("../../src/domain/quotaCache.ts");
const connectionId = "10095-genuinely-exhausted-account";
setQuotaCache(connectionId, "antigravity", {
"gemini-3.7-flash-tiered": {
"gemini-3.8-flash-tiered": {
used: 1000,
total: 1000,
resetAt: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
@@ -68,7 +66,7 @@ describe("#10095 — quotaCache respects Antigravity fractionReported:false", ()
const exhausted = isQuotaExhaustedForRequest(
connectionId,
"antigravity",
"agy/gemini-3.7-flash-tiered"
"agy/gemini-3.8-flash-tiered"
);
assert.equal(
exhausted,
@@ -77,13 +75,12 @@ describe("#10095 — quotaCache respects Antigravity fractionReported:false", ()
);
});
test("issue follow-up model id shape (agy/gemini-3.7-flash-tiered) still resolves its family", async () => {
const { setQuotaCache, isQuotaExhaustedForRequest } = await import(
"../../src/domain/quotaCache.ts"
);
test("issue follow-up model id shape (agy/gemini-3.8-flash-tiered) still resolves its family", async () => {
const { setQuotaCache, isQuotaExhaustedForRequest } =
await import("../../src/domain/quotaCache.ts");
const connectionId = "10095-agy-tiered-family";
setQuotaCache(connectionId, "agy", {
"agy/gemini-3.7-flash-tiered": {
"agy/gemini-3.8-flash-tiered": {
used: 500,
total: 1000,
resetAt: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
@@ -96,12 +93,12 @@ describe("#10095 — quotaCache respects Antigravity fractionReported:false", ()
const exhausted = isQuotaExhaustedForRequest(
connectionId,
"agy",
"agy/gemini-3.7-flash-tiered"
"agy/gemini-3.8-flash-tiered"
);
assert.equal(
exhausted,
false,
"non-regression: family resolution for the agy/gemini-3.7-flash-tiered id must keep working"
"non-regression: family resolution for the agy/gemini-3.8-flash-tiered id must keep working"
);
});
});

View File

@@ -26,9 +26,9 @@ test("T28: antigravity static catalog exposes only callable Gemini tier IDs", ()
const staticIds = (getStaticModelsForProvider("antigravity") || []).map((m) => m.id);
assert.ok(!staticIds.includes("gemini-3-pro-preview"));
assert.ok(staticIds.includes("gemini-3.7-flash-high"));
assert.ok(staticIds.includes("gemini-3.7-flash-medium"));
assert.ok(staticIds.includes("gemini-3.7-flash-low"));
assert.ok(staticIds.includes("gemini-3.8-flash-high"));
assert.ok(staticIds.includes("gemini-3.8-flash-medium"));
assert.ok(staticIds.includes("gemini-3.8-flash-low"));
assert.ok(!staticIds.includes("gemini-3.6-flash-high"));
assert.ok(!staticIds.includes("gemini-3.6-flash-medium"));
assert.ok(!staticIds.includes("gemini-3.6-flash-low"));
@@ -49,21 +49,21 @@ test("T28: antigravity static catalog exposes only callable Gemini tier IDs", ()
assert.ok(!staticIds.includes("gemini-claude-opus-4-5-thinking"));
});
test("T28: agy free-model metadata labels upstream Gemini 3.7 tier IDs", () => {
test("T28: agy free-model metadata labels upstream Gemini 3.8 tier IDs", () => {
const flashNames = Object.fromEntries(
FREE_MODEL_BUDGETS.filter(
(entry) =>
entry.provider === "agy" &&
["gemini-3.7-flash-low", "gemini-3.7-flash-medium", "gemini-3.7-flash-high"].includes(
["gemini-3.8-flash-low", "gemini-3.8-flash-medium", "gemini-3.8-flash-high"].includes(
entry.modelId
)
).map((entry) => [entry.modelId, entry.displayName])
);
assert.deepEqual(flashNames, {
"gemini-3.7-flash-low": "Gemini 3.7 Flash (Low)",
"gemini-3.7-flash-medium": "Gemini 3.7 Flash (Medium)",
"gemini-3.7-flash-high": "Gemini 3.7 Flash (High)",
"gemini-3.8-flash-low": "Gemini 3.8 Flash (Low)",
"gemini-3.8-flash-medium": "Gemini 3.8 Flash (Medium)",
"gemini-3.8-flash-high": "Gemini 3.8 Flash (High)",
});
});

View File

@@ -21,7 +21,7 @@ test("T31: antigravity static catalog exposes client-visible Gemini preview IDs"
// catalog) retired the `gemini-3-pro-preview` alias, so assert the current
// client-visible top flash tier instead.
const staticIds = (getStaticModelsForProvider("antigravity") || []).map((m) => m.id);
assert.ok(staticIds.includes("gemini-3.7-flash-high"));
assert.ok(staticIds.includes("gemini-3.8-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).
@@ -132,8 +132,8 @@ test("opencode-go family: context/output caps match upstream provider docs", ()
// MiniMax M2.x: ~200K context, 131K output
assert.equal(getModelSpec("minimax-m2.7").contextWindow, 204800);
assert.equal(getModelSpec("minimax-m2.7").maxOutputTokens, 131072);
assert.equal(getModelSpec("minimax-m2.5").contextWindow, 200000);
assert.equal(getModelSpec("MiniMax-M2.5").contextWindow, 200000);
assert.equal(getModelSpec("minimax-m2.5").contextWindow, 204800);
assert.equal(getModelSpec("MiniMax-M2.5").contextWindow, 204800);
// DeepSeek V4: 1M context, 384K output
assert.equal(getModelSpec("deepseek-v4-pro").contextWindow, 1000000);

View File

@@ -261,7 +261,7 @@ test("usage service prefers Antigravity retrieveUserQuota over catalog quotaInfo
return new Response(
JSON.stringify({
models: {
"gemini-3.7-flash-high": {
"gemini-3.8-flash-high": {
quotaInfo: {
remainingFraction: 1,
resetTime: new Date(Date.now() + 60_000).toISOString(),
@@ -278,7 +278,7 @@ test("usage service prefers Antigravity retrieveUserQuota over catalog quotaInfo
JSON.stringify({
buckets: [
{
modelId: "gemini-3.7-flash-high",
modelId: "gemini-3.8-flash-high",
remainingFraction: 0.25,
resetTime: new Date(Date.now() + 60_000).toISOString(),
},
@@ -296,9 +296,9 @@ test("usage service prefers Antigravity retrieveUserQuota over catalog quotaInfo
accessToken: `ag-token-live-quota-${Date.now()}`,
});
assert.equal(usage.quotas["gemini-3.7-flash-high"].remainingPercentage, 25);
assert.equal(usage.quotas["gemini-3.7-flash-high"].used, 750);
assert.equal(usage.quotas["gemini-3.7-flash-high"].quotaSource, "retrieveUserQuota");
assert.equal(usage.quotas["gemini-3.8-flash-high"].remainingPercentage, 25);
assert.equal(usage.quotas["gemini-3.8-flash-high"].used, 750);
assert.equal(usage.quotas["gemini-3.8-flash-high"].quotaSource, "retrieveUserQuota");
});
test("usage service preserves Antigravity upstream quota bucket ids", async () => {
@@ -319,9 +319,9 @@ test("usage service preserves Antigravity upstream quota bucket ids", async () =
return new Response(
JSON.stringify({
models: {
"gemini-3.7-flash-low": { quotaInfo: { remainingFraction: 1 } },
"gemini-3.7-flash-medium": { quotaInfo: { remainingFraction: 1 } },
"gemini-3.7-flash-high": { quotaInfo: { remainingFraction: 1 } },
"gemini-3.8-flash-low": { quotaInfo: { remainingFraction: 1 } },
"gemini-3.8-flash-medium": { quotaInfo: { remainingFraction: 1 } },
"gemini-3.8-flash-high": { quotaInfo: { remainingFraction: 1 } },
"gemini-3-flash-agent": { quotaInfo: { remainingFraction: 1 } },
},
}),
@@ -333,8 +333,8 @@ test("usage service preserves Antigravity upstream quota bucket ids", async () =
return new Response(
JSON.stringify({
buckets: [
{ modelId: "gemini-3.7-flash-high", remainingFraction: 0.5 },
{ modelId: "gemini-3.7-flash-low", remainingFraction: 0.25 },
{ modelId: "gemini-3.8-flash-high", remainingFraction: 0.5 },
{ modelId: "gemini-3.8-flash-low", remainingFraction: 0.25 },
],
}),
{ status: 200 }
@@ -349,9 +349,9 @@ test("usage service preserves Antigravity upstream quota bucket ids", async () =
accessToken: `ag-token-legacy-buckets-${Date.now()}`,
});
assert.equal(usage.quotas["gemini-3.7-flash-high"].remainingPercentage, 50);
assert.equal(usage.quotas["gemini-3.7-flash-low"].remainingPercentage, 25);
assert.equal(usage.quotas["gemini-3.7-flash-medium"].remainingPercentage, 100);
assert.equal(usage.quotas["gemini-3.8-flash-high"].remainingPercentage, 50);
assert.equal(usage.quotas["gemini-3.8-flash-low"].remainingPercentage, 25);
assert.equal(usage.quotas["gemini-3.8-flash-medium"].remainingPercentage, 100);
assert.equal(usage.quotas["gemini-3-flash-agent"], undefined);
});