mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
fix(models): canonicalize auth default models
This commit is contained in:
@@ -108,6 +108,7 @@ Docs: https://docs.openclaw.ai
|
||||
- Google/Gemini: normalize nested proxy-provider catalog ids like `google/gemini-3-pro-preview` to `google/gemini-3.1-pro-preview`, so Kilo-style configured catalogs test Gemini 3.1 instead of the retired Gemini 3 Pro id.
|
||||
- Google/Gemini: canonicalize provider-onboarding model alias maps so setup flows preserve settings under `google/gemini-3.1-pro-preview` instead of re-emitting retired Gemini 3 Pro config keys.
|
||||
- Google/Gemini: canonicalize retired Gemini 3 Pro Preview ids inside Google dynamic model resolution so runtime clones also use `google/gemini-3.1-pro-preview`.
|
||||
- Google/Gemini: canonicalize provider-auth default model results before setup hooks and picker returns so auth flows do not re-emit retired `google/gemini-3-pro-preview` selections.
|
||||
- Amazon Bedrock: support `serviceTier` parameter for Bedrock models, configurable via `agents.defaults.params.serviceTier` or per-model in `agents.defaults.models`. Valid values: `default`, `flex`, `priority`, `reserved`. (#64512) Thanks @mobilinkd.
|
||||
- Control UI: read the Quick Settings exec policy badge from `tools.exec.security` instead of the non-schema `agents.defaults.exec.security` path, so configured `full`/`deny` values render accurately. Fixes #78311. Thanks @FriedBack.
|
||||
- Control UI/usage: add transcript-backed historical lineage rollups for rotated logical sessions, with current-instance vs historical-lineage scope controls and long-range presets so usage history stays visible after restarts and updates. Fixes #50701. Thanks @dev-gideon-llc and @BunsDev.
|
||||
|
||||
@@ -586,6 +586,29 @@ describe("applyAuthChoiceLoadedPluginProvider", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("normalizes retired Google Gemini default models returned by auth methods", async () => {
|
||||
const method: ProviderAuthMethod = {
|
||||
id: "google",
|
||||
label: "Google",
|
||||
kind: "custom",
|
||||
run: async () => ({
|
||||
profiles: [],
|
||||
defaultModel: "google/gemini-3-pro-preview",
|
||||
}),
|
||||
};
|
||||
|
||||
const result = await runProviderPluginAuthMethod({
|
||||
config: {},
|
||||
runtime: {} as ApplyAuthChoiceParams["runtime"],
|
||||
prompter: {
|
||||
note: vi.fn(async () => {}),
|
||||
} as unknown as ApplyAuthChoiceParams["prompter"],
|
||||
method,
|
||||
});
|
||||
|
||||
expect(result.defaultModel).toBe("google/gemini-3.1-pro-preview");
|
||||
});
|
||||
|
||||
it("replaces provider-owned default model maps during auth migrations", async () => {
|
||||
const method: ProviderAuthMethod = {
|
||||
id: "local",
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
import { upsertAuthProfile } from "../agents/auth-profiles.js";
|
||||
import { formatLiteralProviderPrefixedModelRef } from "../agents/model-ref-shared.js";
|
||||
import { resolveDefaultAgentWorkspaceDir } from "../agents/workspace.js";
|
||||
import { normalizeAgentModelRefForConfig } from "../config/model-input.js";
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { sanitizeTerminalText } from "../terminal/safe-text.js";
|
||||
@@ -289,9 +290,13 @@ export async function runProviderPluginAuthMethod(params: {
|
||||
await params.prompter.note(result.notes.join("\n"), "Provider notes");
|
||||
}
|
||||
|
||||
const defaultModel = result.defaultModel
|
||||
? normalizeAgentModelRefForConfig(result.defaultModel)
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
config: nextConfig,
|
||||
defaultModel: result.defaultModel,
|
||||
...(defaultModel ? { defaultModel } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user