fix: restore config dry-run schema validation

This commit is contained in:
Peter Steinberger
2026-05-03 13:16:09 +01:00
parent 9a49d143c8
commit 81fea91fda
3 changed files with 9 additions and 4 deletions

View File

@@ -1313,6 +1313,7 @@ function collectDryRunSchemaErrors(params: {
}): ConfigSetDryRunError[] {
const validated = validateConfigObjectRaw(params.config, {
touchedPaths: params.operations.map((operation) => operation.setPath),
validateBundledChannels: true,
});
if (validated.ok) {
return [];

View File

@@ -21989,12 +21989,13 @@ export const GENERATED_BASE_CONFIG_SCHEMA: BaseConfigSchemaResponse = {
"Web channel runtime settings for heartbeat and reconnect behavior when operating web-based chat surfaces. Use reconnect values tuned to your network reliability profile and expected uptime needs.",
},
channels: {
type: "object",
properties: {},
additionalProperties: true,
title: "Channels",
description:
"Channel provider configurations plus shared defaults that control access policies, heartbeat visibility, and per-surface behavior. Keep defaults centralized and override per provider only where required.",
properties: {},
required: [],
additionalProperties: true,
},
discovery: {
type: "object",

View File

@@ -621,9 +621,10 @@ function validateGatewayTailscaleBind(config: OpenClawConfig): ConfigValidationI
*/
export function validateConfigObjectRaw(
raw: unknown,
_opts?: {
opts?: {
sourceRaw?: unknown;
touchedPaths?: ReadonlyArray<ReadonlyArray<string>>;
validateBundledChannels?: boolean;
},
): { ok: true; config: OpenClawConfig } | { ok: false; issues: ConfigValidationIssue[] } {
const normalizedRaw = stripDeprecatedValidationKeys(raw);
@@ -638,7 +639,9 @@ export function validateConfigObjectRaw(
}
const validatedConfig = validated.data as OpenClawConfig;
const channelIssues =
policyIssues.length > 0 ? collectRawBundledChannelConfigIssues(validatedConfig) : [];
policyIssues.length > 0 || opts?.validateBundledChannels
? collectRawBundledChannelConfigIssues(validatedConfig)
: [];
if (channelIssues.length > 0) {
return {
ok: false,