mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 22:40:42 +00:00
Summary: - Hide retired and non-public Google Gemini model IDs from Control UI/chat model catalogs. - Route the bare gemini-3-pro alias to gemini-3.1-pro-preview. - Keep models.list fallback rows filtered by manifest suppressions and update stale pricing-cache expectations. Verification: - pnpm test src/commands/models/list.list-command.forward-compat.test.ts src/commands/models/list.rows.test.ts extensions/google/manifest.test.ts extensions/google/model-id.test.ts extensions/google/provider-models.test.ts extensions/google/provider-policy-api.test.ts extensions/google/media-understanding-provider.video.test.ts src/plugin-sdk/provider-model-id-normalize.test.ts src/plugins/manifest-model-suppression.test.ts src/gateway/server-methods/models.test.ts ui/src/ui/chat-model-select-state.test.ts ui/src/ui/chat-model-ref.test.ts - pnpm test src/gateway/model-pricing-cache.test.ts - pnpm --silent openclaw models list --all --json --provider google / google-vertex hidden-row probe - Testbox pnpm check:changed: https://github.com/openclaw/openclaw/actions/runs/25534551033
36 lines
1.4 KiB
TypeScript
36 lines
1.4 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { normalizeAntigravityModelId, normalizeGoogleModelId } from "./api.js";
|
|
|
|
describe("google model id helpers", () => {
|
|
it.each(["gemini-3-pro", "gemini-3.1-pro", "gemini-3-1-pro"])(
|
|
"adds default -low suffix to bare antigravity pro id: %s",
|
|
(id) => {
|
|
expect(normalizeAntigravityModelId(id)).toBe(`${id}-low`);
|
|
},
|
|
);
|
|
|
|
it.each([
|
|
"gemini-3-pro-low",
|
|
"gemini-3-pro-high",
|
|
"gemini-3.1-flash",
|
|
"claude-opus-4-6-thinking",
|
|
])("keeps already-tiered and non-pro ids unchanged: %s", (id) => {
|
|
expect(normalizeAntigravityModelId(id)).toBe(id);
|
|
});
|
|
|
|
it("maps the deprecated 3.1 flash alias to the real preview model", () => {
|
|
expect(normalizeGoogleModelId("gemini-3.1-flash")).toBe("gemini-3-flash-preview");
|
|
expect(normalizeGoogleModelId("gemini-3.1-flash-preview")).toBe("gemini-3-flash-preview");
|
|
});
|
|
|
|
it("keeps bare Gemini 3.1 Pro as an alias for Google's preview-suffixed API id", () => {
|
|
expect(normalizeGoogleModelId("gemini-3-pro")).toBe("gemini-3.1-pro-preview");
|
|
expect(normalizeGoogleModelId("gemini-3.1-pro")).toBe("gemini-3.1-pro-preview");
|
|
expect(normalizeGoogleModelId("gemini-3.1-pro-preview")).toBe("gemini-3.1-pro-preview");
|
|
});
|
|
|
|
it("adds the preview suffix for gemini 3.1 flash-lite", () => {
|
|
expect(normalizeGoogleModelId("gemini-3.1-flash-lite")).toBe("gemini-3.1-flash-lite-preview");
|
|
});
|
|
});
|