mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-01 12:52:11 +03:00
Split-out PR A from #3584. Normalizes the Antigravity/agy Gemini 3.5 Flash tier IDs to clean public names (gemini-3.5-flash-low/medium/high), maps them to the live upstream IDs at the executor boundary, and removes Antigravity from the global model resolver so the executor owns wire normalization. Maintainer follow-up: kept gemini-3.5-flash-preview as a hidden backward-compat alias routing to the High tier (so saved combos/configs keep working). Live-validated the tier set via the agy CLI catalog. Integrated into release/v3.8.21. Thanks @dhaern!
43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
import { getExecutor, AntigravityExecutor } from "../../open-sse/executors/index.ts";
|
|
|
|
test("getExecutor('agy') returns AntigravityExecutor (not DefaultExecutor)", () => {
|
|
const executor = getExecutor("agy");
|
|
assert.ok(executor instanceof AntigravityExecutor, "agy provider should use AntigravityExecutor");
|
|
});
|
|
|
|
test("getExecutor('antigravity') returns AntigravityExecutor", () => {
|
|
const executor = getExecutor("antigravity");
|
|
assert.ok(
|
|
executor instanceof AntigravityExecutor,
|
|
"antigravity provider should use AntigravityExecutor"
|
|
);
|
|
});
|
|
|
|
test("getExecutor('agy') builds valid streaming URL", () => {
|
|
const executor = getExecutor("agy");
|
|
const url = executor.buildUrl("gemini-3.5-flash-high", true);
|
|
assert.ok(
|
|
url.includes("streamGenerateContent?alt=sse"),
|
|
`expected streaming endpoint URL, got: ${url}`
|
|
);
|
|
});
|
|
|
|
test("getExecutor('agy') builds valid non-streaming URL", () => {
|
|
const executor = getExecutor("agy");
|
|
const url = executor.buildUrl("gemini-3.5-flash-high", false);
|
|
// Antigravity executor always uses streaming endpoint (buildUrl ignores stream flag)
|
|
assert.ok(
|
|
url.includes("streamGenerateContent?alt=sse"),
|
|
`expected streaming endpoint URL (always), got: ${url}`
|
|
);
|
|
});
|
|
|
|
test("getExecutor('agy') buildHeaders returns Bearer auth", () => {
|
|
const executor = getExecutor("agy");
|
|
const headers = executor.buildHeaders({ accessToken: "test-token" });
|
|
assert.equal(headers.Authorization, "Bearer test-token");
|
|
});
|