fix: mask result sanitize params

This commit is contained in:
2026-10-10 05:15:23 +05:00
parent 0b3eeab959
commit 421f078f90
2 changed files with 12 additions and 10 deletions
@@ -44,6 +44,7 @@
import {
applySourceDefaults,
clampSourceAwareMaxes,
sanitizeSchemaParams,
type ToolSchema,
} from "$lib/registry-schema";
import { onMount } from "svelte";
@@ -99,11 +100,14 @@
if (!stepTool?.runMask) return;
const input = i === 0 ? source : stepResults[i - 1];
if (!input) return;
// Same contract as executor.ts: params are sanitized against the
// schema with the step input as the source context.
const stepSchema = toolSchemaOf(step);
const params = stepSchema
? sanitizeSchemaParams(stepSchema, step.params, { source: input })
: step.params;
try {
next[step.key] = stepTool.runMask({
params: step.params,
source: input,
});
next[step.key] = stepTool.runMask({ params, source: input });
} catch {
next[step.key] = null;
}