mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-07 22:44:16 +00:00
fix(models): refresh gpt/gemini alias defaults (#38638, thanks @ademczuk)
Co-authored-by: ademczuk <andrew.demczuk@gmail.com>
This commit is contained in:
@@ -278,6 +278,7 @@ Docs: https://docs.openclaw.ai
|
||||
- Telegram/status SecretRef read-only resolution: resolve env-backed bot-token SecretRefs in config-only/status inspection while respecting provider source/defaults and env allowlists, so status no longer crashes or reports false-ready tokens for disallowed providers. (#39130) Thanks @neocody.
|
||||
- Agents/OpenAI WS max-token zero forwarding: treat `maxTokens: 0` as an explicit value in websocket `response.create` payloads (instead of dropping it as falsy), with regression coverage for zero-token forwarding. (#39148) Thanks @scoootscooob.
|
||||
- Podman/.env gateway bind precedence: evaluate `OPENCLAW_GATEWAY_BIND` after sourcing `.env` in `run-openclaw-podman.sh` so env-file overrides are honored. (#38785) Thanks @majinyu666.
|
||||
- Models/default alias refresh: bump `gpt` to `openai/gpt-5.4` and Gemini defaults to `gemini-3.1` preview aliases (including normalization/default wiring) to track current model IDs. (#38638) Thanks @ademczuk.
|
||||
|
||||
## 2026.3.2
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { loginGeminiCliOAuth } from "./oauth.js";
|
||||
|
||||
const PROVIDER_ID = "google-gemini-cli";
|
||||
const PROVIDER_LABEL = "Gemini CLI OAuth";
|
||||
const DEFAULT_MODEL = "google-gemini-cli/gemini-3-pro-preview";
|
||||
const DEFAULT_MODEL = "google-gemini-cli/gemini-3.1-pro-preview";
|
||||
const ENV_VARS = [
|
||||
"OPENCLAW_GEMINI_OAUTH_CLIENT_ID",
|
||||
"OPENCLAW_GEMINI_OAUTH_CLIENT_SECRET",
|
||||
|
||||
@@ -544,6 +544,12 @@ export function normalizeGoogleModelId(id: string): string {
|
||||
if (id === "gemini-3-flash") {
|
||||
return "gemini-3-flash-preview";
|
||||
}
|
||||
if (id === "gemini-3.1-pro") {
|
||||
return "gemini-3.1-pro-preview";
|
||||
}
|
||||
if (id === "gemini-3.1-flash") {
|
||||
return "gemini-3.1-flash-preview";
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { applyAgentDefaultPrimaryModel } from "./model-default.js";
|
||||
|
||||
export const GOOGLE_GEMINI_DEFAULT_MODEL = "google/gemini-3-pro-preview";
|
||||
export const GOOGLE_GEMINI_DEFAULT_MODEL = "google/gemini-3.1-pro-preview";
|
||||
|
||||
export function applyGoogleGeminiModelDefault(cfg: OpenClawConfig): {
|
||||
next: OpenClawConfig;
|
||||
|
||||
@@ -24,12 +24,12 @@ const DEFAULT_MODEL_ALIASES: Readonly<Record<string, string>> = {
|
||||
sonnet: "anthropic/claude-sonnet-4-6",
|
||||
|
||||
// OpenAI
|
||||
gpt: "openai/gpt-5.2",
|
||||
gpt: "openai/gpt-5.4",
|
||||
"gpt-mini": "openai/gpt-5-mini",
|
||||
|
||||
// Google Gemini (3.x are preview ids in the catalog)
|
||||
gemini: "google/gemini-3-pro-preview",
|
||||
"gemini-flash": "google/gemini-3-flash-preview",
|
||||
gemini: "google/gemini-3.1-pro-preview",
|
||||
"gemini-flash": "google/gemini-3.1-flash-preview",
|
||||
};
|
||||
|
||||
const DEFAULT_MODEL_COST: ModelDefinitionConfig["cost"] = {
|
||||
|
||||
@@ -35,7 +35,7 @@ describe("applyModelDefaults", () => {
|
||||
defaults: {
|
||||
models: {
|
||||
"anthropic/claude-opus-4-6": {},
|
||||
"openai/gpt-5.2": {},
|
||||
"openai/gpt-5.4": {},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -43,7 +43,7 @@ describe("applyModelDefaults", () => {
|
||||
const next = applyModelDefaults(cfg);
|
||||
|
||||
expect(next.agents?.defaults?.models?.["anthropic/claude-opus-4-6"]?.alias).toBe("opus");
|
||||
expect(next.agents?.defaults?.models?.["openai/gpt-5.2"]?.alias).toBe("gpt");
|
||||
expect(next.agents?.defaults?.models?.["openai/gpt-5.4"]?.alias).toBe("gpt");
|
||||
});
|
||||
|
||||
it("does not override existing aliases", () => {
|
||||
@@ -67,8 +67,8 @@ describe("applyModelDefaults", () => {
|
||||
agents: {
|
||||
defaults: {
|
||||
models: {
|
||||
"google/gemini-3-pro-preview": { alias: "" },
|
||||
"google/gemini-3-flash-preview": {},
|
||||
"google/gemini-3.1-pro-preview": { alias: "" },
|
||||
"google/gemini-3.1-flash-preview": {},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -76,8 +76,8 @@ describe("applyModelDefaults", () => {
|
||||
|
||||
const next = applyModelDefaults(cfg);
|
||||
|
||||
expect(next.agents?.defaults?.models?.["google/gemini-3-pro-preview"]?.alias).toBe("");
|
||||
expect(next.agents?.defaults?.models?.["google/gemini-3-flash-preview"]?.alias).toBe(
|
||||
expect(next.agents?.defaults?.models?.["google/gemini-3.1-pro-preview"]?.alias).toBe("");
|
||||
expect(next.agents?.defaults?.models?.["google/gemini-3.1-flash-preview"]?.alias).toBe(
|
||||
"gemini-flash",
|
||||
);
|
||||
});
|
||||
|
||||
@@ -83,6 +83,7 @@ function makeResolvedDelivery(): Extract<DeliveryTargetResolution, { ok: true }>
|
||||
to: "123456",
|
||||
accountId: undefined,
|
||||
threadId: undefined,
|
||||
mode: "explicit",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user