From 9b7df414e6486d8675c6c5c186d63b2d219cca37 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 14 Jan 2026 23:27:51 +0000 Subject: [PATCH] test: add gemini 3 antigravity switch live repro --- src/agents/google-gemini-switch.live.test.ts | 83 ++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/agents/google-gemini-switch.live.test.ts diff --git a/src/agents/google-gemini-switch.live.test.ts b/src/agents/google-gemini-switch.live.test.ts new file mode 100644 index 000000000..4abc2b0fb --- /dev/null +++ b/src/agents/google-gemini-switch.live.test.ts @@ -0,0 +1,83 @@ +import { completeSimple, getModel } from "@mariozechner/pi-ai"; +import { describe, expect, it } from "vitest"; + +const GEMINI_KEY = process.env.GEMINI_API_KEY ?? ""; +const LIVE = + process.env.GEMINI_LIVE_TEST === "1" || process.env.LIVE === "1"; + +const describeLive = LIVE && GEMINI_KEY ? describe : describe.skip; + +describeLive("gemini live switch", () => { + it( + "handles unsigned tool calls from Antigravity when switching to Gemini 3", + async () => { + const now = Date.now(); + const model = getModel("google", "gemini-3-pro-preview"); + + const res = await completeSimple( + model, + { + messages: [ + { + role: "user", + content: "Reply with ok.", + timestamp: now, + }, + { + role: "assistant", + content: [ + { + type: "toolCall", + id: "call_1", + name: "bash", + arguments: { command: "ls -la" }, + // No thoughtSignature: simulates Claude via Antigravity. + }, + ], + api: "google-gemini-cli", + provider: "google-antigravity", + model: "claude-sonnet-4-20250514", + usage: { + input: 0, + output: 0, + cacheRead: 0, + cacheWrite: 0, + totalTokens: 0, + cost: { + input: 0, + output: 0, + cacheRead: 0, + cacheWrite: 0, + total: 0, + }, + }, + stopReason: "stop", + timestamp: now, + }, + ], + tools: [ + { + name: "bash", + description: "Run shell command", + parameters: { + type: "object", + properties: { + command: { type: "string" }, + }, + required: ["command"], + }, + }, + ], + }, + { + apiKey: GEMINI_KEY, + reasoning: "low", + maxTokens: 128, + }, + ); + + expect(res.stopReason).not.toBe("error"); + }, + 20000, + ); +});