fix: reuse validators for identical output schemas

This commit is contained in:
Peter authored and Ysopwnable committed 2026-10-10 19:29:16 +08:00
1 parent ca7ef69c0c
commit 1887e1120e
1 file changed
+5 -1
+5 -1
View File
@@ -40,7 +40,11 @@ export async function verifyGhidraBoundaries(
ajv.validateSchema(tool[key]),
`${tool.name} ${key}: ${JSON.stringify(ajv.errors)}`,
);
validators.set(tool.name, ajv.compile(tool.outputSchema));
validators.set(
tool.name,
(tool.outputSchema?.$id && ajv.getSchema(tool.outputSchema.$id)) ||
ajv.compile(tool.outputSchema),
);
}
let successfulCalls = 0;
let rejectedCalls = 0;