From 3101047234b042338dd6f9f52238d3cae84d1d61 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 21 Feb 2026 15:07:38 +0100 Subject: [PATCH] feat(models): add Gemini 3.1 support --- CHANGELOG.md | 1 + src/agents/google-gemini-switch.live.test.ts | 116 ++++++++++--------- 2 files changed, 61 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b43df36734..ef1155c3cc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Docs: https://docs.openclaw.ai ### Changes +- Models/Google: add Gemini 3.1 support (`google/gemini-3.1-pro-preview`). - Providers/Onboarding: add Volcano Engine (Doubao) and BytePlus providers/models (including coding variants), wire onboarding auth choices for interactive + non-interactive flows, and align docs to `volcengine-api-key`. (#7967) Thanks @funmore123. - Channels/CLI: add per-account/channel `defaultTo` outbound routing fallback so `openclaw agent --deliver` can send without explicit `--reply-to` when a default target is configured. (#16985) Thanks @KirillShchetinin. - Channels: allow per-channel model overrides via `channels.modelByChannel` and note them in /status. Thanks @thewilloftheshadow. diff --git a/src/agents/google-gemini-switch.live.test.ts b/src/agents/google-gemini-switch.live.test.ts index 164bfd8677a..7c253b03503 100644 --- a/src/agents/google-gemini-switch.live.test.ts +++ b/src/agents/google-gemini-switch.live.test.ts @@ -9,68 +9,72 @@ const LIVE = isTruthyEnvValue(process.env.GEMINI_LIVE_TEST) || isTruthyEnvValue( 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 googleModels = ["gemini-3-pro-preview", "gemini-3.1-pro-preview"] as const; - 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: { + for (const modelId of googleModels) { + it(`handles unsigned tool calls from Antigravity when switching to ${modelId}`, async () => { + const now = Date.now(); + const model = getModel("google", modelId); + + 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, - total: 0, + totalTokens: 0, + cost: { + input: 0, + output: 0, + cacheRead: 0, + cacheWrite: 0, + total: 0, + }, }, + stopReason: "stop", + timestamp: now, }, - stopReason: "stop", - timestamp: now, - }, - ], - tools: [ - { - name: "bash", - description: "Run shell command", - parameters: Type.Object({ - command: Type.String(), - }), - }, - ], - }, - { - apiKey: GEMINI_KEY, - reasoning: "low", - maxTokens: 128, - }, - ); + ], + tools: [ + { + name: "bash", + description: "Run shell command", + parameters: Type.Object({ + command: Type.String(), + }), + }, + ], + }, + { + apiKey: GEMINI_KEY, + reasoning: "low", + maxTokens: 128, + }, + ); - expect(res.stopReason).not.toBe("error"); - }, 20000); + expect(res.stopReason).not.toBe("error"); + }, 20000); + } });