mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
fix(routing): add agy to executor map so it uses AntigravityExecutor (#2957)
Integrated into release/v3.8.8
This commit is contained in:
@@ -48,6 +48,7 @@ import { DoubaoWebExecutor } from "./doubao-web.ts";
|
||||
|
||||
const executors = {
|
||||
antigravity: new AntigravityExecutor(),
|
||||
agy: new AntigravityExecutor(),
|
||||
"gemini-cli": new GeminiCLIExecutor(),
|
||||
github: new GithubExecutor(),
|
||||
qoder: new QoderExecutor(),
|
||||
|
||||
39
tests/unit/executor-agy.test.ts
Normal file
39
tests/unit/executor-agy.test.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
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-flash", 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-flash", 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");
|
||||
});
|
||||
Reference in New Issue
Block a user