

























@@ -16,6 +16,7 @@ import {
1616import { resolveDefaultAgentDir } from "./agent-scope.js";
1717import { modelSupportsInput as modelCatalogEntrySupportsInput } from "./model-catalog-lookup.js";
1818import type { ModelCatalogEntry, ModelInputType } from "./model-catalog.types.js";
19+import { normalizeConfiguredProviderCatalogModelId } from "./model-ref-shared.js";
1920import { buildConfiguredModelCatalog } from "./model-selection-shared.js";
2021import { ensureOpenClawModelsJson } from "./models-config.js";
2122import { normalizeProviderId } from "./provider-id.js";
@@ -196,14 +197,15 @@ function normalizePersistedModelCatalogEntry(
196197contextTokens?: number;
197198},
198199): ModelCatalogEntry | undefined {
199-const id = normalizeOptionalString(entry.id) ?? "";
200-if (!id) {
200+const rawId = normalizeOptionalString(entry.id) ?? "";
201+if (!rawId) {
201202return undefined;
202203}
203204const provider = normalizeProviderId(providerRaw);
204205if (!provider) {
205206return undefined;
206207}
208+const id = normalizeConfiguredProviderCatalogModelId(provider, rawId);
207209const name = normalizeOptionalString(entry.name ?? id) || id;
208210const contextWindow =
209211typeof entry?.contextWindow === "number" && entry.contextWindow > 0
@@ -379,14 +381,15 @@ export async function loadModelCatalog(params?: {
379381logStage("suppress-resolver-ready");
380382381383for (const entry of entries) {
382-const id = normalizeOptionalString(entry?.id) ?? "";
383-if (!id) {
384+const rawId = normalizeOptionalString(entry?.id) ?? "";
385+if (!rawId) {
384386continue;
385387}
386388const provider = normalizeOptionalString(entry?.provider) ?? "";
387389if (!provider) {
388390continue;
389391}
392+const id = normalizeConfiguredProviderCatalogModelId(provider, rawId);
390393if (shouldSuppressBuiltInModel({ provider, id })) {
391394continue;
392395}
@@ -425,7 +428,14 @@ export async function loadModelCatalog(params?: {
425428},
426429});
427430if (supplemental.length > 0) {
428-appendCatalogEntriesIfAbsent(models, supplemental);
431+const normalizedSupplemental: ModelCatalogEntry[] = [];
432+for (const entry of supplemental) {
433+normalizedSupplemental.push({
434+ ...entry,
435+id: normalizeConfiguredProviderCatalogModelId(entry.provider, entry.id),
436+});
437+}
438+appendCatalogEntriesIfAbsent(models, normalizedSupplemental);
429439}
430440}
431441logStage("plugin-models-merged", `entries=${models.length}`);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。