

























@@ -3,6 +3,7 @@ import path from "node:path";
33import { collectConfiguredModelRefs } from "@openclaw/model-catalog-core/configured-model-refs";
44import { isCanonicalDottedDecimalIPv4, isLoopbackIpAddress } from "@openclaw/net-policy/ip";
55import { normalizeLowercaseStringOrEmpty } from "@openclaw/normalization-core/string-coerce";
6+import { sanitizeForLog } from "../../packages/terminal-core/src/ansi.js";
67import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agents/agent-scope.js";
78import { isPathInside } from "../infra/path-guards.js";
89import { planManifestModelCatalogSuppressions } from "../model-catalog/index.js";
@@ -42,7 +43,7 @@ import { isRecord, resolveUserPath } from "../utils.js";
4243import { findDuplicateAgentDirs, formatDuplicateAgentDirError } from "./agent-dirs.js";
4344import { appendAllowedValuesHint, summarizeAllowedValues } from "./allowed-values.js";
4445import { GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA } from "./bundled-channel-config-metadata.generated.js";
45-import { collectChannelSchemaMetadata } from "./channel-config-metadata.js";
46+import { collectChannelSchemaMetadataWithOwnership } from "./channel-config-metadata.js";
4647import { shouldSuppressMissingCodexPluginDiagnostics } from "./codex-plugin-diagnostics.js";
4748import { materializeRuntimeConfig } from "./materialize.js";
4849import type { OpenClawConfig, ConfigValidationIssue } from "./types.js";
@@ -1072,6 +1073,14 @@ function validateConfigObjectWithPluginsBase(
10721073return `${baseLocal}.${errorPath}`;
10731074};
107410751076+const formatChannelConfigIssueMessage = (message: string, pluginId?: string): string => {
1077+const safePluginId = pluginId ? sanitizeForLog(pluginId).trim() : "";
1078+if (safePluginId) {
1079+return `invalid config for plugin ${safePluginId}: ${message}`;
1080+}
1081+return formatRawChannelConfigIssueMessage(message);
1082+};
1083+10751084type RegistryInfo = {
10761085registry: PluginManifestRegistry;
10771086knownIds?: Set<string>;
@@ -1081,6 +1090,7 @@ function validateConfigObjectWithPluginsBase(
10811090string,
10821091{
10831092schema?: Record<string, unknown>;
1093+pluginId?: string;
10841094}
10851095>;
10861096};
@@ -1211,6 +1221,7 @@ function validateConfigObjectWithPluginsBase(
12111221string,
12121222{
12131223schema?: Record<string, unknown>;
1224+pluginId?: string;
12141225}
12151226> => {
12161227const info = ensureRegistry();
@@ -1220,10 +1231,13 @@ function validateConfigObjectWithPluginsBase(
12201231(entry) => [entry.channelId, { schema: entry.schema }] as const,
12211232),
12221233);
1223-for (const entry of collectChannelSchemaMetadata(info.registry)) {
1234+for (const entry of collectChannelSchemaMetadataWithOwnership(info.registry)) {
12241235const current = info.channelSchemas.get(entry.id);
12251236if (entry.configSchema) {
1226-info.channelSchemas.set(entry.id, { schema: entry.configSchema });
1237+info.channelSchemas.set(entry.id, {
1238+schema: entry.configSchema,
1239+pluginId: entry.schemaPluginOrigin === "bundled" ? undefined : entry.schemaPluginId,
1240+});
12271241continue;
12281242}
12291243if (!current) {
@@ -1531,12 +1545,12 @@ function validateConfigObjectWithPluginsBase(
15311545continue;
15321546}
153315471534-const channelSchema = ensureChannelSchemas().get(trimmed)?.schema;
1535-if (!channelSchema) {
1548+const channelSchema = ensureChannelSchemas().get(trimmed);
1549+if (!channelSchema?.schema) {
15361550continue;
15371551}
15381552const result = validateJsonSchemaValue({
1539-schema: channelSchema,
1553+schema: channelSchema.schema,
15401554cacheKey: `channel:${trimmed}`,
15411555value: config.channels[trimmed],
15421556applyDefaults: true, // Always apply defaults for AJV schema validation;
@@ -1548,7 +1562,7 @@ function validateConfigObjectWithPluginsBase(
15481562error.path === "<root>" ? `channels.${trimmed}` : `channels.${trimmed}.${error.path}`;
15491563issues.push({
15501564path: pathResult,
1551-message: formatRawChannelConfigIssueMessage(error.message),
1565+message: formatChannelConfigIssueMessage(error.message, channelSchema.pluginId),
15521566allowedValues: error.allowedValues,
15531567allowedValuesHiddenCount: error.allowedValuesHiddenCount,
15541568});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。