

























@@ -38,6 +38,7 @@ import {
3838import { createLiveTargetMatcher } from "../agents/live-target-matcher.js";
3939import { isLiveProfileKeyModeEnabled, isLiveTestEnabled } from "../agents/live-test-helpers.js";
4040import { getApiKeyForModel, resolveEnvApiKey } from "../agents/model-auth.js";
41+import { normalizeStaticProviderModelId } from "../agents/model-ref-shared.js";
4142import { normalizeProviderId } from "../agents/model-selection.js";
4243import { shouldSuppressBuiltInModel } from "../agents/model-suppression.js";
4344import { ensureOpenClawModelsJson } from "../agents/models-config.js";
@@ -94,7 +95,6 @@ const GATEWAY_LIVE_HEARTBEAT_MS = Math.max(
9495);
9596const GATEWAY_LIVE_STRIP_SCAFFOLDING_MODEL_KEYS = new Set([
9697"google/gemini-3-flash-preview",
97-"google/gemini-3-pro-preview",
9898"google/gemini-3.1-flash-lite-preview",
9999"google/gemini-3.1-pro-preview",
100100"google/gemini-3.1-pro-preview-customtools",
@@ -703,6 +703,32 @@ describe("resolveExplicitLiveModelCandidates", () => {
703703expect(candidates).toEqual([model]);
704704});
705705706+it("normalizes retired Google Gemini refs before targeted lookup", () => {
707+const model = createGatewayLiveTestModel("google", "gemini-3.1-pro-preview");
708+const matcher = createLiveTargetMatcher({
709+providerFilter: new Set(["google"]),
710+modelFilter: new Set(["google/gemini-3-pro-preview"]),
711+env: {},
712+});
713+const candidates = resolveExplicitLiveModelCandidates({
714+modelRegistry: {
715+find(provider, modelId) {
716+expect(provider).toBe("google");
717+expect(modelId).toBe("gemini-3.1-pro-preview");
718+return model;
719+},
720+getAll() {
721+throw new Error("explicit model lookup should not enumerate registry");
722+},
723+},
724+modelFilter: new Set(["google/gemini-3-pro-preview"]),
725+providerFilter: new Set(["google"]),
726+targetMatcher: matcher,
727+});
728+729+expect(candidates).toEqual([model]);
730+});
731+706732it("falls back to enumeration for ambiguous model-only filters", () => {
707733const matcher = createLiveTargetMatcher({
708734providerFilter: null,
@@ -1632,7 +1658,9 @@ function parseExplicitLiveModelRef(
16321658const slash = trimmed.indexOf("/");
16331659if (slash !== -1) {
16341660const provider = normalizeProviderId(trimmed.slice(0, slash));
1635-const modelId = trimmed.slice(slash + 1).trim();
1661+const modelId = provider
1662+ ? normalizeStaticProviderModelId(provider, trimmed.slice(slash + 1)).trim()
1663+ : "";
16361664return provider && modelId ? { provider, modelId } : null;
16371665}
16381666if (!providerFilter || providerFilter.size !== 1) {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。