Skip to content

Commit 915c820

Browse files
authored
fix(google): stop appending preview to flash lite
Normalize Google Gemini 3.1 Flash Lite routing to the GA model id and keep the retired preview spelling as a compatibility alias. Align default alias docs, FAQ guidance, and deprecated-model manifest recommendations with the GA id. Fixes #86151. Co-authored-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent cd7994f commit 915c820

22 files changed

Lines changed: 97 additions & 72 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Docs: https://docs.openclaw.ai
2121
- Agents/media: keep async cron media completions scoped to their run session while preserving direct delivery for stale generated-media success and failure notifications. (#86529) Thanks @ai-hpc.
2222
- Gateway: emit plugin `session_end`/`session_start` hooks when `agent.send` rotates or replaces a session id, keeping hook lifecycle state aligned with `sessions.changed` notifications. Fixes #83507. (#85875) Thanks @brokemac79.
2323
- OpenShell/SSH: reject malformed generated exec commands before sandbox/session setup so unresolved workflow placeholders fail fast instead of reaching the remote shell. Fixes #72373. Thanks @brokemac79.
24+
- Google: stop normalizing `gemini-3.1-flash-lite` to the retired preview endpoint and update Flash Lite alias guidance to the GA model id. Fixes #86151. (#86240) Thanks @SebTardif.
2425
- Installer: make Alpine apk installs cover Git, verify the Node runtime floor, try `nodejs-current`, and report Alpine version guidance when repositories only provide older Node packages.
2526
- Agents/media: send direct fallback for generated media still missing after an active requester wake fails. (#85489) Thanks @fuller-stack-dev.
2627
- Agents: derive overflow compaction budgets from provider-reported and synthetic over-budget token counts so confirmed context overflows compact before retrying. (#70473) Thanks @fuller-stack-dev.

docs/gateway/config-agents.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -503,16 +503,16 @@ Time format in system prompt. Default: `auto` (OS preference).
503503

504504
**Built-in alias shorthands** (only apply when the model is in `agents.defaults.models`):
505505

506-
| Alias | Model |
507-
| ------------------- | -------------------------------------- |
508-
| `opus` | `anthropic/claude-opus-4-6` |
509-
| `sonnet` | `anthropic/claude-sonnet-4-6` |
510-
| `gpt` | `openai/gpt-5.5` |
511-
| `gpt-mini` | `openai/gpt-5.4-mini` |
512-
| `gpt-nano` | `openai/gpt-5.4-nano` |
513-
| `gemini` | `google/gemini-3.1-pro-preview` |
514-
| `gemini-flash` | `google/gemini-3-flash-preview` |
515-
| `gemini-flash-lite` | `google/gemini-3.1-flash-lite-preview` |
506+
| Alias | Model |
507+
| ------------------- | ------------------------------- |
508+
| `opus` | `anthropic/claude-opus-4-6` |
509+
| `sonnet` | `anthropic/claude-sonnet-4-6` |
510+
| `gpt` | `openai/gpt-5.5` |
511+
| `gpt-mini` | `openai/gpt-5.4-mini` |
512+
| `gpt-nano` | `openai/gpt-5.4-nano` |
513+
| `gemini` | `google/gemini-3.1-pro-preview` |
514+
| `gemini-flash` | `google/gemini-3-flash-preview` |
515+
| `gemini-flash-lite` | `google/gemini-3.1-flash-lite` |
516516

517517
Your configured aliases always win over defaults.
518518

docs/help/faq-models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ troubleshooting, see the main [FAQ](/help/faq).
289289
- `gpt-nano` → `openai/gpt-5.4-nano`
290290
- `gemini` → `google/gemini-3.1-pro-preview`
291291
- `gemini-flash` → `google/gemini-3-flash-preview`
292-
- `gemini-flash-lite` → `google/gemini-3.1-flash-lite-preview`
292+
- `gemini-flash-lite` → `google/gemini-3.1-flash-lite`
293293

294294
If you set your own alias with the same name, your value wins.
295295

extensions/google/api.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ describe("google generative ai helpers", () => {
132132
{
133133
contextWindow: 1,
134134
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
135-
id: "gemini-3.1-flash-lite-preview",
135+
id: "gemini-3.1-flash-lite",
136136
input: ["text"],
137137
maxTokens: 1,
138138
name: "Gemini Flash Lite",

extensions/google/cli-backend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
const GEMINI_MODEL_ALIASES: Record<string, string> = {
88
pro: "gemini-3.1-pro-preview",
99
flash: "gemini-3.1-flash-preview",
10-
"flash-lite": "gemini-3.1-flash-lite-preview",
10+
"flash-lite": "gemini-3.1-flash-lite",
1111
};
1212
const GEMINI_CLI_DEFAULT_MODEL_REF = "google-gemini-cli/gemini-3-flash-preview";
1313

extensions/google/model-id.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ describe("google model id helpers", () => {
3636
);
3737
});
3838

39-
it("adds the preview suffix for gemini 3.1 flash-lite", () => {
40-
expect(normalizeGoogleModelId("gemini-3.1-flash-lite")).toBe("gemini-3.1-flash-lite-preview");
39+
it("keeps GA gemini-3.1-flash-lite unchanged and maps old preview name to GA", () => {
40+
expect(normalizeGoogleModelId("gemini-3.1-flash-lite")).toBe("gemini-3.1-flash-lite");
41+
expect(normalizeGoogleModelId("gemini-3.1-flash-lite-preview")).toBe("gemini-3.1-flash-lite");
4142
});
4243
});

extensions/google/model-id.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ export function normalizeGoogleModelId(id: string): string {
1818
if (id === "gemini-3.1-pro") {
1919
return "gemini-3.1-pro-preview";
2020
}
21-
if (id === "gemini-3.1-flash-lite") {
22-
return "gemini-3.1-flash-lite-preview";
21+
// Gemini 3.1 Flash Lite graduated to GA on 2026-05-07; the -preview
22+
// endpoint is deprecated (shutdown 2026-05-25). Map old preview name
23+
// to the stable GA id.
24+
if (id === "gemini-3.1-flash-lite-preview") {
25+
return "gemini-3.1-flash-lite";
2326
}
2427
if (id === "gemini-3.1-flash" || id === "gemini-3.1-flash-preview") {
2528
return "gemini-3-flash-preview";

extensions/google/openclaw.plugin.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"gemini-3-pro-preview": "gemini-3.1-pro-preview",
1515
"gemini-3-flash": "gemini-3-flash-preview",
1616
"gemini-3.1-pro": "gemini-3.1-pro-preview",
17-
"gemini-3.1-flash-lite": "gemini-3.1-flash-lite-preview",
17+
"gemini-3.1-flash-lite-preview": "gemini-3.1-flash-lite",
1818
"gemini-3.1-flash": "gemini-3-flash-preview",
1919
"gemini-3.1-flash-preview": "gemini-3-flash-preview"
2020
}
@@ -25,7 +25,7 @@
2525
"gemini-3-pro-preview": "gemini-3.1-pro-preview",
2626
"gemini-3-flash": "gemini-3-flash-preview",
2727
"gemini-3.1-pro": "gemini-3.1-pro-preview",
28-
"gemini-3.1-flash-lite": "gemini-3.1-flash-lite-preview",
28+
"gemini-3.1-flash-lite-preview": "gemini-3.1-flash-lite",
2929
"gemini-3.1-flash": "gemini-3-flash-preview",
3030
"gemini-3.1-flash-preview": "gemini-3-flash-preview"
3131
}
@@ -36,7 +36,7 @@
3636
"gemini-3-pro-preview": "gemini-3.1-pro-preview",
3737
"gemini-3-flash": "gemini-3-flash-preview",
3838
"gemini-3.1-pro": "gemini-3.1-pro-preview",
39-
"gemini-3.1-flash-lite": "gemini-3.1-flash-lite-preview",
39+
"gemini-3.1-flash-lite-preview": "gemini-3.1-flash-lite",
4040
"gemini-3.1-flash": "gemini-3-flash-preview",
4141
"gemini-3.1-flash-preview": "gemini-3-flash-preview"
4242
}
@@ -133,12 +133,12 @@
133133
{
134134
"provider": "google",
135135
"model": "gemini-2.5-flash-lite-preview-09-25",
136-
"reason": "Google shut down this Gemini 2.5 Flash-Lite preview on 2026-03-31. Use google/gemini-3.1-flash-lite-preview."
136+
"reason": "Google shut down this Gemini 2.5 Flash-Lite preview on 2026-03-31. Use google/gemini-3.1-flash-lite."
137137
},
138138
{
139139
"provider": "google",
140140
"model": "gemini-2.5-flash-lite-preview-09-2025",
141-
"reason": "Google shut down this Gemini 2.5 Flash-Lite preview on 2026-03-31. Use google/gemini-3.1-flash-lite-preview."
141+
"reason": "Google shut down this Gemini 2.5 Flash-Lite preview on 2026-03-31. Use google/gemini-3.1-flash-lite."
142142
},
143143
{
144144
"provider": "google",
@@ -298,12 +298,12 @@
298298
{
299299
"provider": "google-gemini-cli",
300300
"model": "gemini-2.5-flash-lite-preview-09-25",
301-
"reason": "Google shut down this Gemini 2.5 Flash-Lite preview on 2026-03-31. Use google-gemini-cli/gemini-3.1-flash-lite-preview."
301+
"reason": "Google shut down this Gemini 2.5 Flash-Lite preview on 2026-03-31. Use google-gemini-cli/gemini-3.1-flash-lite."
302302
},
303303
{
304304
"provider": "google-gemini-cli",
305305
"model": "gemini-2.5-flash-lite-preview-09-2025",
306-
"reason": "Google shut down this Gemini 2.5 Flash-Lite preview on 2026-03-31. Use google-gemini-cli/gemini-3.1-flash-lite-preview."
306+
"reason": "Google shut down this Gemini 2.5 Flash-Lite preview on 2026-03-31. Use google-gemini-cli/gemini-3.1-flash-lite."
307307
},
308308
{
309309
"provider": "google-gemini-cli",
@@ -463,12 +463,12 @@
463463
{
464464
"provider": "google-vertex",
465465
"model": "gemini-2.5-flash-lite-preview-09-25",
466-
"reason": "Google shut down this Gemini 2.5 Flash-Lite preview on 2026-03-31. Use google-vertex/gemini-3.1-flash-lite-preview."
466+
"reason": "Google shut down this Gemini 2.5 Flash-Lite preview on 2026-03-31. Use google-vertex/gemini-3.1-flash-lite."
467467
},
468468
{
469469
"provider": "google-vertex",
470470
"model": "gemini-2.5-flash-lite-preview-09-2025",
471-
"reason": "Google shut down this Gemini 2.5 Flash-Lite preview on 2026-03-31. Use google-vertex/gemini-3.1-flash-lite-preview."
471+
"reason": "Google shut down this Gemini 2.5 Flash-Lite preview on 2026-03-31. Use google-vertex/gemini-3.1-flash-lite."
472472
},
473473
{
474474
"provider": "google-vertex",

extensions/google/provider-models.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe("resolveGoogleGeminiForwardCompatModel", () => {
6464
provider: "google-gemini-cli",
6565
modelId: "gemini-2.5-flash-lite",
6666
models: [
67-
createTemplateModel("google-gemini-cli", "gemini-3.1-flash-lite-preview", {
67+
createTemplateModel("google-gemini-cli", "gemini-3.1-flash-lite", {
6868
contextWindow: 1_048_576,
6969
api: "google-gemini-cli",
7070
baseUrl: "https://cloudcode-pa.googleapis.com",
@@ -286,7 +286,7 @@ describe("resolveGoogleGeminiForwardCompatModel", () => {
286286
const models = [
287287
createTemplateModel("google", "gemini-3-pro-preview", { reasoning: true }),
288288
createTemplateModel("google", "gemini-3-flash-preview", { reasoning: true }),
289-
createTemplateModel("google", "gemini-3.1-flash-lite-preview", { reasoning: true }),
289+
createTemplateModel("google", "gemini-3.1-flash-lite", { reasoning: true }),
290290
];
291291

292292
expectModelFields(
@@ -409,13 +409,13 @@ describe("resolveGoogleGeminiForwardCompatModel", () => {
409409
providerId: "google-antigravity",
410410
ctx: createContext({
411411
provider: "google-antigravity",
412-
modelId: "gemini-3.1-flash-lite-preview",
412+
modelId: "gemini-3.1-flash-lite",
413413
models,
414414
}),
415415
}),
416416
{
417417
provider: "google-antigravity",
418-
id: "gemini-3.1-flash-lite-preview",
418+
id: "gemini-3.1-flash-lite",
419419
api: "openai-completions",
420420
contextWindow: 1_048_576,
421421
},
@@ -440,12 +440,12 @@ describe("resolveGoogleGeminiForwardCompatModel", () => {
440440
providerId: "google-vertex",
441441
ctx: createContext({
442442
provider: "google-vertex",
443-
modelId: "gemini-3.1-flash-lite-preview",
443+
modelId: "gemini-3.1-flash-lite",
444444
models: [
445445
createTemplateModel("google-gemini-cli", "gemini-3-flash-preview", {
446446
contextWindow: 128_000,
447447
}),
448-
createTemplateModel("google-gemini-cli", "gemini-3.1-flash-lite-preview", {
448+
createTemplateModel("google-gemini-cli", "gemini-3.1-flash-lite", {
449449
contextWindow: 1_048_576,
450450
}),
451451
],
@@ -454,7 +454,7 @@ describe("resolveGoogleGeminiForwardCompatModel", () => {
454454

455455
expectModelFields(model, {
456456
provider: "google-vertex",
457-
id: "gemini-3.1-flash-lite-preview",
457+
id: "gemini-3.1-flash-lite",
458458
contextWindow: 1_048_576,
459459
reasoning: false,
460460
});

extensions/google/provider-models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const GEMINI_2_5_PRO_TEMPLATE_IDS = ["gemini-2.5-pro"] as const;
2323
const GEMINI_2_5_FLASH_LITE_TEMPLATE_IDS = ["gemini-2.5-flash-lite"] as const;
2424
const GEMINI_2_5_FLASH_TEMPLATE_IDS = ["gemini-2.5-flash"] as const;
2525
const GEMINI_3_1_PRO_TEMPLATE_IDS = ["gemini-3.1-pro-preview", "gemini-3-pro-preview"] as const;
26-
const GEMINI_3_1_FLASH_LITE_TEMPLATE_IDS = ["gemini-3.1-flash-lite-preview"] as const;
26+
const GEMINI_3_1_FLASH_LITE_TEMPLATE_IDS = ["gemini-3.1-flash-lite"] as const;
2727
const GEMINI_3_1_FLASH_TEMPLATE_IDS = ["gemini-3-flash-preview", "gemini-2.5-flash"] as const;
2828
const GEMINI_3_PRO_ANTIGRAVITY_TEMPLATE_IDS = ["gemini-3-pro-low", "gemini-3-pro-high"] as const;
2929
const GEMINI_3_FLASH_ANTIGRAVITY_TEMPLATE_IDS = ["gemini-3-flash"] as const;

0 commit comments

Comments
 (0)