fix: normalize exact Gemini proxy refs · openclaw/openclaw@1923db6
steipete
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -66,6 +66,7 @@ Docs: https://docs.openclaw.ai
|
66 | 66 | |
67 | 67 | ### Fixes |
68 | 68 | |
| 69 | +- Google/Gemini: normalize retired nested Gemini 3 Pro Preview ids when resolving exact configured proxy-provider refs, so `kilocode/google/gemini-3-pro-preview` resolves to `kilocode/google/gemini-3.1-pro-preview` for Gemini 3.1 testing. |
69 | 70 | - CLI: strip generic OSC terminal escape payloads from sanitized output fields, preventing clipboard/title escape bodies from leaking into commitment tables and other terminal-safe text. Thanks @shakkernerd. |
70 | 71 | - Codex app-server: match connector-backed plugin approval elicitations by stable connector id so enabled destructive actions no longer fall through to display-name-only rejection. |
71 | 72 | - Build: replace selected build utility `tsx` preloads with Node native type stripping so Node 26 build paths no longer emit `DEP0205` module loader deprecation warnings. (#78584) Thanks @keshavbotagent. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -316,10 +316,13 @@ function resolveExactConfiguredProviderRef(
|
316 | 316 | const provider = normalizeLowercaseStringOrEmpty(configuredProvider); |
317 | 317 | return { |
318 | 318 | provider, |
319 | | -model: normalizeStaticProviderModelId(provider, modelRaw.trim(), { |
320 | | -allowManifestNormalization: params.allowManifestNormalization, |
321 | | -manifestPlugins: params.manifestPlugins, |
322 | | -}), |
| 319 | +model: normalizeConfiguredProviderCatalogModelId( |
| 320 | +provider, |
| 321 | +normalizeStaticProviderModelId(provider, modelRaw.trim(), { |
| 322 | +allowManifestNormalization: params.allowManifestNormalization, |
| 323 | +manifestPlugins: params.manifestPlugins, |
| 324 | +}), |
| 325 | +), |
323 | 326 | }; |
324 | 327 | } |
325 | 328 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1768,6 +1768,34 @@ describe("model-selection", () => {
|
1768 | 1768 | ).toEqual({ provider: "modelstudio", model: "qwen3.6-plus" }); |
1769 | 1769 | }); |
1770 | 1770 | |
| 1771 | +it("normalizes retired nested Gemini ids in exact configured provider refs", () => { |
| 1772 | +const cfg = { |
| 1773 | +agents: { |
| 1774 | +defaults: { |
| 1775 | +model: { primary: "kilocode/google/gemini-3-pro-preview" }, |
| 1776 | +}, |
| 1777 | +}, |
| 1778 | +models: { |
| 1779 | +providers: { |
| 1780 | +kilocode: { |
| 1781 | +api: "openai-completions", |
| 1782 | +baseUrl: "https://kilocode.test/v1", |
| 1783 | +models: [{ id: "google/gemini-3-pro-preview", name: "Gemini 3 Pro" }], |
| 1784 | +}, |
| 1785 | +}, |
| 1786 | +}, |
| 1787 | +} as unknown as OpenClawConfig; |
| 1788 | + |
| 1789 | +expect( |
| 1790 | +resolveConfiguredModelRef({ |
| 1791 | + cfg, |
| 1792 | +defaultProvider: "anthropic", |
| 1793 | +defaultModel: "claude-opus-4-6", |
| 1794 | +allowPluginNormalization: false, |
| 1795 | +}), |
| 1796 | +).toEqual({ provider: "kilocode", model: "google/gemini-3.1-pro-preview" }); |
| 1797 | +}); |
| 1798 | + |
1771 | 1799 | it("keeps legacy modelstudio aliases when no exact foreign api owner is configured", () => { |
1772 | 1800 | const cfg = { |
1773 | 1801 | agents: { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -37,4 +37,40 @@ describe("resolveConfiguredEntries", () => {
|
37 | 37 | expect(entries[0]?.aliases).toEqual(["Codex"]); |
38 | 38 | expect(entries[1]?.tags).toEqual(new Set(["fallback#1", "configured"])); |
39 | 39 | }); |
| 40 | + |
| 41 | +it("normalizes retired nested Gemini ids in configured provider rows", () => { |
| 42 | +const { entries } = resolveConfiguredEntries({ |
| 43 | +agents: { |
| 44 | +defaults: { |
| 45 | +model: { primary: "kilocode/google/gemini-3-pro-preview" }, |
| 46 | +models: { |
| 47 | +"kilocode/google/gemini-3-pro-preview": { alias: "Kilo Gemini" }, |
| 48 | +}, |
| 49 | +}, |
| 50 | +}, |
| 51 | +models: { |
| 52 | +providers: { |
| 53 | +kilocode: { |
| 54 | +api: "openai-completions", |
| 55 | +baseUrl: "https://kilocode.test/v1", |
| 56 | +models: [ |
| 57 | +{ |
| 58 | +id: "google/gemini-3-pro-preview", |
| 59 | +name: "Gemini 3 Pro", |
| 60 | +reasoning: true, |
| 61 | +input: ["text", "image"], |
| 62 | +cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }, |
| 63 | +contextWindow: 1_048_576, |
| 64 | +maxTokens: 65_536, |
| 65 | +}, |
| 66 | +], |
| 67 | +}, |
| 68 | +}, |
| 69 | +}, |
| 70 | +}); |
| 71 | + |
| 72 | +expect(entries.map((entry) => entry.key)).toEqual(["kilocode/google/gemini-3.1-pro-preview"]); |
| 73 | +expect(entries[0]?.aliases).toEqual(["Kilo Gemini"]); |
| 74 | +expect(entries[0]?.tags).toEqual(new Set(["default", "configured"])); |
| 75 | +}); |
40 | 76 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { |
2 | 2 | buildModelAliasIndex, |
3 | | -parseModelRef, |
4 | 3 | resolveConfiguredModelRef, |
5 | 4 | resolveModelRefFromString, |
6 | 5 | } from "../../agents/model-selection.js"; |
@@ -74,11 +73,17 @@ export function resolveConfiguredEntries(cfg: OpenClawConfig) {
|
74 | 73 | }); |
75 | 74 | |
76 | 75 | for (const key of Object.keys(cfg.agents?.defaults?.models ?? {})) { |
77 | | -const parsed = parseModelRef(key, DEFAULT_PROVIDER, DISPLAY_MODEL_PARSE_OPTIONS); |
78 | | -if (!parsed) { |
| 76 | +const resolved = resolveModelRefFromString({ |
| 77 | + cfg, |
| 78 | +raw: key, |
| 79 | +defaultProvider: DEFAULT_PROVIDER, |
| 80 | + aliasIndex, |
| 81 | + ...DISPLAY_MODEL_PARSE_OPTIONS, |
| 82 | +}); |
| 83 | +if (!resolved) { |
79 | 84 | continue; |
80 | 85 | } |
81 | | -addEntry(parsed, "configured"); |
| 86 | +addEntry(resolved.ref, "configured"); |
82 | 87 | } |
83 | 88 | |
84 | 89 | const entries: ConfiguredEntry[] = order.map((key) => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。