惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
宝玉的分享
宝玉的分享
月光博客
月光博客
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
小众软件
小众软件
量子位
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
U
Unit 42
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
H
Help Net Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: normalize gemini provider catalog defaults · opencla...
steipete · 2026-05-12 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -7,6 +7,7 @@ Docs: https://docs.openclaw.ai

77

### Changes

88
99

- Models/OpenAI CLI auth: make `openclaw models auth login --provider openai` start the ChatGPT/Codex account login by default, while `--method api-key` remains the explicit OpenAI API-key setup path.

10+

- Google/Gemini: normalize retired Gemini 3 Pro Preview ids in provider catalog rows when API-key onboarding only reapplies the agent default, so emitted config keeps testing `google/gemini-3.1-pro-preview`.

1011

- Docs/subagents: document `agents.defaults.subagents.announceTimeoutMs` in the sub-agent and configuration references. (#75509) Thanks @akrimm702.

1112

- Cron: add direct `cron.get`, `openclaw cron get <id>`, and agent-tool `get` support for inspecting one stored cron job by id. (#75117) Thanks @samzong.

1213

- Agents/tools: add per-sender tool policies with canonical channel-scoped sender keys, so operators can restrict dangerous tools by requester identity across global, agent, group, core, bundled, and plugin tool surfaces. (#66933) Thanks @JerranC.

Original file line numberDiff line numberDiff line change

@@ -68,6 +68,42 @@ describe("google default model", () => {

6868

});

6969

});

7070
71+

it("normalizes retired Gemini provider catalog rows when the primary is already current", () => {

72+

const applied = applyGoogleGeminiModelDefault({

73+

agents: {

74+

defaults: {

75+

model: {

76+

primary: GOOGLE_GEMINI_DEFAULT_MODEL,

77+

},

78+

},

79+

},

80+

models: {

81+

providers: {

82+

google: {

83+

api: "google-generative-ai",

84+

baseUrl: "https://generativelanguage.googleapis.com/v1beta",

85+

models: [

86+

{

87+

id: "google/gemini-3-pro-preview",

88+

name: "Gemini 3 Pro",

89+

contextWindow: 1_000_000,

90+

maxTokens: 8192,

91+

input: ["text"],

92+

cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

93+

reasoning: true,

94+

},

95+

],

96+

},

97+

},

98+

},

99+

} as OpenClawConfig);

100+
101+

expect(applied.changed).toBe(true);

102+

expect(applied.next.models?.providers?.google?.models?.map((model) => model.id)).toEqual([

103+

GOOGLE_GEMINI_DEFAULT_MODEL,

104+

]);

105+

});

106+
71107

it("no-ops when already on the target default", () => {

72108

const cfg = {

73109

agents: { defaults: { model: { primary: GOOGLE_GEMINI_DEFAULT_MODEL } } },

Original file line numberDiff line numberDiff line change

@@ -5,31 +5,53 @@ import {

55
66

export const GOOGLE_GEMINI_DEFAULT_MODEL = "google/gemini-3.1-pro-preview";

77

const RETIRED_GOOGLE_GEMINI_MODEL_REFS = new Set([

8+

"gemini-3-pro",

9+

"gemini-3-pro-preview",

810

"google/gemini-3-pro",

911

"google/gemini-3-pro-preview",

1012

]);

1113
14+

function isRetiredGeminiModelRef(value: unknown): boolean {

15+

if (typeof value !== "string") {

16+

return false;

17+

}

18+

const modelRef = value.trim();

19+

if (RETIRED_GOOGLE_GEMINI_MODEL_REFS.has(modelRef)) {

20+

return true;

21+

}

22+

return modelRef.endsWith("/gemini-3-pro") || modelRef.endsWith("/gemini-3-pro-preview");

23+

}

24+
1225

function hasRetiredGeminiDefaultModelRefs(cfg: OpenClawConfig): boolean {

1326

const defaults = cfg.agents?.defaults;

1427

const model = defaults?.model as unknown;

1528

if (model && typeof model === "object") {

1629

const fallbacks = (model as { fallbacks?: unknown }).fallbacks;

1730

if (

1831

Array.isArray(fallbacks) &&

19-

fallbacks.some(

20-

(fallback) =>

21-

typeof fallback === "string" && RETIRED_GOOGLE_GEMINI_MODEL_REFS.has(fallback),

22-

)

32+

fallbacks.some((fallback) => isRetiredGeminiModelRef(fallback))

2333

) {

2434

return true;

2535

}

2636

}

2737
2838

const models = defaults?.models;

29-

return Boolean(

39+

if (

3040

models &&

3141

typeof models === "object" &&

32-

Object.keys(models).some((modelRef) => RETIRED_GOOGLE_GEMINI_MODEL_REFS.has(modelRef)),

42+

Object.keys(models).some((modelRef) => isRetiredGeminiModelRef(modelRef))

43+

) {

44+

return true;

45+

}

46+
47+

const providerConfigs = cfg.models?.providers;

48+

if (!providerConfigs) {

49+

return false;

50+

}

51+

return Object.values(providerConfigs).some((providerConfig) =>

52+

Array.isArray(providerConfig.models)

53+

? providerConfig.models.some((providerModel) => isRetiredGeminiModelRef(providerModel.id))

54+

: false,

3355

);

3456

}

3557
Original file line numberDiff line numberDiff line change

@@ -3,6 +3,7 @@ import type { OpenClawConfig } from "../config/config.js";

33

import type { AgentModelEntryConfig } from "../config/types.agent-defaults.js";

44

import type { ModelDefinitionConfig } from "../config/types.models.js";

55

import {

6+

applyAgentDefaultModelPrimary,

67

applyProviderConfigWithDefaultModelPreset,

78

applyProviderConfigWithModelCatalogPreset,

89

applyProviderConfigWithDefaultModel,

@@ -184,6 +185,36 @@ describe("onboard auth provider config merges", () => {

184185

]);

185186

});

186187
188+

it("normalizes retired Google provider catalog ids when applying only an agent default", () => {

189+

const next = applyAgentDefaultModelPrimary(

190+

{

191+

models: {

192+

providers: {

193+

google: {

194+

api: "google-generative-ai",

195+

baseUrl: "https://generativelanguage.googleapis.com/v1beta",

196+

models: [makeModel("google/gemini-3-pro-preview")],

197+

},

198+

kilocode: {

199+

api: "openai-completions",

200+

baseUrl: "https://kilocode.example.com/v1",

201+

models: [makeModel("google/gemini-3-pro-preview")],

202+

},

203+

},

204+

},

205+

},

206+

"google/gemini-3.1-pro-preview",

207+

);

208+
209+

expect(next.models?.providers?.google?.models?.map((m) => m.id)).toEqual([

210+

"google/gemini-3.1-pro-preview",

211+

]);

212+

expect(next.models?.providers?.kilocode?.models?.map((m) => m.id)).toEqual([

213+

"google/gemini-3.1-pro-preview",

214+

]);

215+

expect(next.agents?.defaults?.model).toEqual({ primary: "google/gemini-3.1-pro-preview" });

216+

});

217+
187218

it("supports single default model convenience wrapper", () => {

188219

const next = applyProviderConfigWithDefaultModel(

189220

{},

Original file line numberDiff line numberDiff line change

@@ -103,6 +103,30 @@ function normalizeProviderModelsForConfig(

103103

return mutated ? next : models;

104104

}

105105
106+

function normalizeModelProvidersForConfig(

107+

providers: Record<string, ModelProviderConfig> | undefined,

108+

): Record<string, ModelProviderConfig> | undefined {

109+

if (!providers) {

110+

return providers;

111+

}

112+
113+

let mutated = false;

114+

const nextProviders: Record<string, ModelProviderConfig> = {};

115+

for (const [providerId, providerConfig] of Object.entries(providers)) {

116+

const models = Array.isArray(providerConfig.models)

117+

? normalizeProviderModelsForConfig(providerId, providerConfig.models)

118+

: providerConfig.models;

119+

if (models !== providerConfig.models) {

120+

mutated = true;

121+

nextProviders[providerId] = { ...providerConfig, models };

122+

continue;

123+

}

124+

nextProviders[providerId] = providerConfig;

125+

}

126+
127+

return mutated ? nextProviders : providers;

128+

}

129+
106130

function resolveProviderModelMergeState(

107131

cfg: OpenClawConfig,

108132

providerId: string,

@@ -261,6 +285,7 @@ export function applyAgentDefaultModelPrimary(

261285

);

262286

const normalizedModels =

263287

defaults?.models === undefined ? undefined : normalizeAgentModelMapForConfig(defaults.models);

288+

const normalizedProviders = normalizeModelProvidersForConfig(cfg.models?.providers);

264289

return {

265290

...cfg,

266291

agents: {

@@ -274,6 +299,14 @@ export function applyAgentDefaultModelPrimary(

274299

...(normalizedModels !== undefined ? { models: normalizedModels } : undefined),

275300

},

276301

},

302+

...(normalizedProviders !== undefined

303+

? {

304+

models: {

305+

...cfg.models,

306+

providers: normalizedProviders,

307+

},

308+

}

309+

: undefined),

277310

};

278311

}

279312