mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-03 05:45:04 +03:00
fix(tests): update T28/T31 for gemini dynamic model sync
Gemini AI Studio no longer has a hardcoded model registry — models come from API sync. Updated tests: - T28: assert gemini registry is empty (API sync), check gemini-cli instead - T31: check antigravity static catalog for pro-high/pro-low model IDs
This commit is contained in:
@@ -5,12 +5,14 @@ import { getModelInfoCore } from "../../open-sse/services/model.ts";
|
||||
import { REGISTRY } from "../../open-sse/config/providerRegistry.ts";
|
||||
import { getStaticModelsForProvider } from "../../src/app/api/providers/[id]/models/route.ts";
|
||||
|
||||
test("T28: gemini catalog includes preview models from 9router", () => {
|
||||
test("T28: gemini-cli catalog includes preview models, gemini uses API sync", () => {
|
||||
// Gemini (AI Studio) no longer has a hardcoded registry — models come from
|
||||
// API sync via /api/providers/:id/models with pageSize=1000.
|
||||
const geminiIds = REGISTRY.gemini.models.map((m) => m.id);
|
||||
const geminiCliIds = REGISTRY["gemini-cli"].models.map((m) => m.id);
|
||||
assert.equal(geminiIds.length, 0, "gemini models should be empty (populated by API sync)");
|
||||
|
||||
assert.ok(geminiIds.includes("gemini-3.1-flash-lite-preview"));
|
||||
assert.ok(geminiIds.includes("gemini-3-flash-preview"));
|
||||
// gemini-cli still has hardcoded models (Cloud Code doesn't have a models API)
|
||||
const geminiCliIds = REGISTRY["gemini-cli"].models.map((m) => m.id);
|
||||
assert.ok(geminiCliIds.includes("gemini-3.1-flash-lite-preview"));
|
||||
assert.ok(geminiCliIds.includes("gemini-3-flash-preview"));
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@ import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
const { REGISTRY } = await import("../../open-sse/config/providerRegistry.ts");
|
||||
const { getStaticModelsForProvider } = await import("../../src/app/api/providers/[id]/models/route.ts");
|
||||
const { resolveModelAlias: resolveDeprecatedAlias } =
|
||||
await import("../../open-sse/services/modelDeprecation.ts");
|
||||
const { normalizeThinkingLevel } = await import("../../open-sse/services/thinkingBudget.ts");
|
||||
@@ -14,10 +15,12 @@ const {
|
||||
capThinkingBudget,
|
||||
} = await import("../../src/shared/constants/modelSpecs.ts");
|
||||
|
||||
test("T31: registry exposes Gemini 3.1 Pro High/Low model IDs", () => {
|
||||
const geminiIds = REGISTRY.gemini.models.map((m) => m.id);
|
||||
assert.ok(geminiIds.includes("gemini-3.1-pro-high"));
|
||||
assert.ok(geminiIds.includes("gemini-3.1-pro-low"));
|
||||
test("T31: antigravity static catalog exposes Gemini 3.1 Pro High/Low model IDs", () => {
|
||||
// gemini-3.1-pro-high/low are Antigravity (Cloud Code sandbox) models,
|
||||
// not Gemini AI Studio models. They live in the static catalog, not the registry.
|
||||
const staticIds = (getStaticModelsForProvider("antigravity") || []).map((m) => m.id);
|
||||
assert.ok(staticIds.includes("gemini-3.1-pro-high"));
|
||||
assert.ok(staticIds.includes("gemini-3.1-pro-low"));
|
||||
});
|
||||
|
||||
test("T31: legacy Gemini aliases resolve to Gemini 3.1 IDs", () => {
|
||||
|
||||
Reference in New Issue
Block a user