Skip to content

Commit 7d5afcb

Browse files
zhangguiping-xydtclawsweeper[bot]claude
authored
fix #84745: scope Google preview model normalization to Google providers only (#84762)
Summary: - The branch scopes config-time Google Gemini preview model normalization to Google providers or nested `google/` proxy suffixes, adds model-picker regression coverage, and adds a changelog entry. - Reproducibility: yes. by source inspection. Current main sends every provider suffix through the Google prev ... i-3-flash` deterministically becomes `litellm/gemini-3-flash-preview`; I did not run a live cron preflight. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(config): scope Google preview model normalization to Google provi… - PR branch already contained follow-up commit before automerge: fix #84745: scope Google preview model normalization to Google provid… - PR branch already contained follow-up commit before automerge: fix #84745: preserve proxy Google model normalization Validation: - ClawSweeper review passed for head c59163c. - Required merge gates passed before the squash merge. Prepared head SHA: c59163c Review: #84762 (comment) Co-authored-by: zhang-guiping <zhang.guiping@xydigit.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Co-authored-by: 张贵萍0668001030 <zhang.guiping@xydigit.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
1 parent bbf3eec commit 7d5afcb

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Docs: https://docs.openclaw.ai
2424
- Docker: prune package-excluded plugin source workspaces and dependency closures so runtime images do not keep packages for plugins that were not opted in.
2525
- Providers/Ollama: treat Docker/OrbStack host aliases as local Ollama endpoints so `ollama-local` marker auth works when OpenClaw runs inside a VM/container and Ollama runs on the host. Fixes #84875.
2626
- QA-Lab: keep explicitly searchable/deferred OpenClaw dynamic tool rows report-only by default so tool-coverage gates do not treat mock discovery gaps as hard product failures. (#80319) Thanks @100yenadmin.
27+
- Agents/config: keep non-Google provider model refs from being rewritten by Google Gemini preview-id normalization. (#84762) Thanks @zhangguiping-xydt.
2728
- Agents: cap heartbeat model bleed context hints by the stored session window when runtime model metadata is unavailable, so overflow recovery advice does not suggest a larger window than the active session actually has.
2829
- Control UI/Web Push: use `https://openclaw.ai` as the generated default VAPID subject instead of the old localhost mailbox so iOS PWA push setup uses an Apple-acceptable subject when `OPENCLAW_VAPID_SUBJECT` is unset. Fixes #83134. (#83317) Thanks @IWhatsskill.
2930
- Agents/Pi: keep embedded session transcript writes from tripping false takeover detection after packaged npm onboarding agent turns.

src/commands/model-picker.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,16 @@ describe("applyModelAllowlist", () => {
14491449
});
14501450
});
14511451

1452+
it("keeps non-Google provider Gemini-looking refs unchanged while writing selected models", () => {
1453+
const config = {} as OpenClawConfig;
1454+
1455+
const next = applyModelAllowlist(config, ["litellm/gemini-3-flash", "litellm/gemini-3.1-pro"]);
1456+
expect(next.agents?.defaults?.models).toEqual({
1457+
"litellm/gemini-3-flash": {},
1458+
"litellm/gemini-3.1-pro": {},
1459+
});
1460+
});
1461+
14521462
it("preserves entries outside scoped allowlist updates", () => {
14531463
const config = {
14541464
agents: {

src/config/model-input.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export function toAgentModelListLike(model?: AgentModelConfig): AgentModelListLi
6767
return model;
6868
}
6969

70+
const GOOGLE_PROVIDER_IDS = new Set(["google", "google-gemini-cli", "google-vertex"]);
71+
7072
export function normalizeAgentModelRefForConfig(model: string): string {
7173
const trimmed = model.trim();
7274
const slash = trimmed.indexOf("/");
@@ -75,7 +77,11 @@ export function normalizeAgentModelRefForConfig(model: string): string {
7577
}
7678

7779
const provider = normalizeProviderId(trimmed.slice(0, slash));
78-
const normalizedModel = normalizeGooglePreviewModelId(trimmed.slice(slash + 1));
80+
const modelSuffix = trimmed.slice(slash + 1);
81+
const normalizedModel =
82+
GOOGLE_PROVIDER_IDS.has(provider) || modelSuffix.startsWith("google/")
83+
? normalizeGooglePreviewModelId(modelSuffix)
84+
: modelSuffix;
7985
return modelKeyForConfig(provider, normalizedModel);
8086
}
8187

0 commit comments

Comments
 (0)