feat(models): add Gemini 3.1 support

This commit is contained in:
Peter Steinberger
2026-02-21 15:07:38 +01:00
parent 581868365d
commit 3101047234
2 changed files with 61 additions and 56 deletions

View File

@@ -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.

View File

@@ -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);
}
});