mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 18:20:43 +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
48 lines
1.5 KiB
TypeScript
48 lines
1.5 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { normalizeConfig } from "./provider-policy-api.js";
|
|
|
|
describe("google provider policy public artifact", () => {
|
|
it("normalizes Google provider config without loading the full provider plugin", () => {
|
|
expect(
|
|
normalizeConfig({
|
|
provider: "google",
|
|
providerConfig: {
|
|
baseUrl: "https://generativelanguage.googleapis.com",
|
|
api: "google-generative-ai",
|
|
apiKey: "GEMINI_API_KEY",
|
|
models: [
|
|
{
|
|
id: "gemini-3-pro",
|
|
name: "Gemini 3 Pro",
|
|
reasoning: true,
|
|
input: ["text", "image"],
|
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
contextWindow: 1_048_576,
|
|
maxTokens: 65_536,
|
|
},
|
|
],
|
|
},
|
|
}),
|
|
).toMatchObject({
|
|
baseUrl: "https://generativelanguage.googleapis.com/v1beta",
|
|
models: [{ id: "gemini-3.1-pro-preview" }],
|
|
});
|
|
});
|
|
|
|
it("preserves explicit OpenAI-compatible Google endpoints during normalization", () => {
|
|
expect(
|
|
normalizeConfig({
|
|
provider: "google",
|
|
providerConfig: {
|
|
baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
|
|
api: "openai-completions",
|
|
models: [],
|
|
},
|
|
}),
|
|
).toMatchObject({
|
|
baseUrl: "https://generativelanguage.googleapis.com/v1beta/openai",
|
|
api: "openai-completions",
|
|
});
|
|
});
|
|
});
|