mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:50:43 +00:00
fix: restore config dry-run schema validation
This commit is contained in:
@@ -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 [];
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user