





















@@ -44,6 +44,7 @@ import { collectConfiguredModelRefs } from "./model-refs.js";
4444import type { OpenClawConfig, ConfigValidationIssue } from "./types.js";
4545import { coerceSecretRef } from "./types.secrets.js";
4646import { OpenClawSchema } from "./zod-schema.js";
47+import { isBuiltInModelProviderOverlayId } from "./zod-schema.core.js";
47484849const LEGACY_REMOVED_PLUGIN_IDS = new Set(["google-antigravity-auth", "google-gemini-cli-auth"]);
4950const BLOCKED_PLUGIN_CANDIDATE_PREFIX = "blocked plugin candidate:";
@@ -75,6 +76,38 @@ function stripDeprecatedValidationKeys(raw: unknown): unknown {
7576};
7677}
777879+function materializeBundledModelProviderOverlays(config: OpenClawConfig): OpenClawConfig {
80+const providers = config.models?.providers;
81+if (!providers) {
82+return config;
83+}
84+let nextProviders: typeof providers | undefined;
85+for (const [providerId, providerConfig] of Object.entries(providers)) {
86+if (
87+!isBuiltInModelProviderOverlayId(providerId) ||
88+(providerConfig.baseUrl && Array.isArray(providerConfig.models))
89+) {
90+continue;
91+}
92+nextProviders ??= { ...providers };
93+nextProviders[providerId] = {
94+ ...providerConfig,
95+baseUrl: providerConfig.baseUrl ?? "",
96+models: providerConfig.models ?? [],
97+};
98+}
99+if (!nextProviders) {
100+return config;
101+}
102+return {
103+ ...config,
104+models: {
105+ ...config.models,
106+providers: nextProviders,
107+},
108+};
109+}
110+78111function stripPreservedLegacyRootKeysForValidation(
79112raw: unknown,
80113keys?: readonly string[],
@@ -765,7 +798,7 @@ export function validateConfigObjectRaw(
765798issues: mergeUnsupportedMutableSecretRefIssues(policyIssues, schemaIssues),
766799};
767800}
768-const validatedConfig = validated.data as OpenClawConfig;
801+const validatedConfig = materializeBundledModelProviderOverlays(validated.data as OpenClawConfig);
769802const channelIssues =
770803policyIssues.length > 0 || opts?.validateBundledChannels
771804 ? collectRawBundledChannelConfigIssues(validatedConfig)
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。