perf(config): scope dry-run legacy validation

This commit is contained in:
Vincent Koc
2026-04-13 20:40:52 +01:00
parent e02c6ca82a
commit 25a2ea4480
7 changed files with 200 additions and 10 deletions

View File

@@ -921,8 +921,13 @@ function selectDryRunRefsForResolution(params: { refs: SecretRef[]; allowExecInD
return { refsToResolve, skippedExecRefs };
}
function collectDryRunSchemaErrors(config: OpenClawConfig): ConfigSetDryRunError[] {
const validated = validateConfigObjectRaw(config);
function collectDryRunSchemaErrors(params: {
config: OpenClawConfig;
operations: ReadonlyArray<ConfigSetOperation>;
}): ConfigSetDryRunError[] {
const validated = validateConfigObjectRaw(params.config, {
touchedPaths: params.operations.map((operation) => operation.setPath),
});
if (validated.ok) {
return [];
}
@@ -1062,7 +1067,12 @@ export async function runConfigSet(opts: {
);
}
if (requiresFullSchemaValidation) {
errors.push(...collectDryRunSchemaErrors(nextConfig));
errors.push(
...collectDryRunSchemaErrors({
config: nextConfig,
operations,
}),
);
}
if (hasJsonMode || hasBuilderMode) {
errors.push(