Files
OmniRoute/tests/unit/executor-antigravity-protocol.test.ts
backryun 888c872459 refactor(antigravity): align official clients and callable catalog (#8013)
* fix(antigravity): preserve protocol fidelity and fail closed

* chore: add PR-numbered changelog fragment

* test: split oversized Antigravity suites

* refactor(antigravity): align official IDE and CLI identities

* fix(antigravity): align catalog with callable models

* test(antigravity): update 2 test files to renamed version-cache API (#8013 fix)

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: nguyenha935 <208228297+nguyenha935@users.noreply.github.com>
Co-authored-by: backryun <backryun@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Co-authored-by: nguyenha935 <nguyenha935@users.noreply.github.com>
Co-authored-by: Probe Test <probe@example.com>
2026-07-22 20:41:19 -03:00

26 lines
1019 B
TypeScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { test } from "node:test";
import assert from "node:assert/strict";
import { AntigravityExecutor } from "../../open-sse/executors/antigravity.ts";
test("AntigravityExecutor.transformRequest preserves prompt text byte-for-byte", async () => {
const executor = new AntigravityExecutor();
const text = "OmniRoute, OpenCode, Cursor — keep this exact text 👩🏽‍💻";
const body = {
request: {
contents: [{ role: "user", parts: [{ text }] }],
},
};
const result = await executor.transformRequest("antigravity/gemini-3.1-pro", body, true, {
projectId: "project-1",
});
if (result instanceof Response) throw new Error("Unexpected Response from transformRequest");
const transformedText = (result.request.contents as Array<{ parts: Array<{ text?: string }> }>)[0]
.parts[0].text;
assert.equal(transformedText, text);
assert.deepEqual(Buffer.from(transformedText ?? ""), Buffer.from(text));
assert.equal(transformedText?.includes(""), text.includes(""));
});