
























@@ -3,6 +3,7 @@ import {
33type LegacyConfigMigrationSpec,
44type LegacyConfigRule,
55} from "../../../config/legacy.shared.js";
6+import { isRecord } from "./legacy-config-record-shared.js";
67import { migrateLegacyXSearchConfig } from "./legacy-x-search-migrate.js";
7889const X_SEARCH_RULE: LegacyConfigRule = {
@@ -11,7 +12,40 @@ const X_SEARCH_RULE: LegacyConfigRule = {
1112'tools.web.x_search.apiKey moved to the xAI plugin; use plugins.entries.xai.config.webSearch.apiKey instead. Run "openclaw doctor --fix".',
1213};
131415+const BUNDLED_DISCOVERY_COMPAT_RULE: LegacyConfigRule = {
16+path: ["plugins", "allow"],
17+message:
18+'plugins.allow now gates bundled provider discovery by default; run "openclaw doctor --fix" to preserve legacy bundled provider compatibility as plugins.bundledDiscovery="compat", or set plugins.bundledDiscovery="allowlist" to keep the stricter behavior.',
19+requireSourceLiteral: true,
20+match: (value, root) => {
21+if (!Array.isArray(value) || value.length === 0) {
22+return false;
23+}
24+const plugins = isRecord(root.plugins) ? root.plugins : undefined;
25+return plugins?.bundledDiscovery === undefined;
26+},
27+};
28+1429export const LEGACY_CONFIG_MIGRATIONS_RUNTIME_PROVIDERS: LegacyConfigMigrationSpec[] = [
30+defineLegacyConfigMigration({
31+id: "plugins.allow->plugins.bundledDiscovery.compat",
32+describe: "Preserve legacy bundled provider discovery for existing restrictive allowlists",
33+legacyRules: [BUNDLED_DISCOVERY_COMPAT_RULE],
34+apply: (raw, changes) => {
35+const plugins = isRecord(raw.plugins) ? raw.plugins : undefined;
36+if (!plugins || plugins.bundledDiscovery !== undefined) {
37+return;
38+}
39+const allow = plugins.allow;
40+if (!Array.isArray(allow) || allow.length === 0) {
41+return;
42+}
43+plugins.bundledDiscovery = "compat";
44+changes.push(
45+'Set plugins.bundledDiscovery="compat" to preserve legacy bundled provider discovery for this restrictive plugins.allow config.',
46+);
47+},
48+}),
1549defineLegacyConfigMigration({
1650id: "tools.web.x_search.apiKey->plugins.entries.xai.config.webSearch.apiKey",
1751describe: "Move legacy x_search auth into the xAI plugin webSearch config",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。