File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 * through the optional `log` callback.
1717 */
1818
19- import type { ITool } from '../core/tools/ITool.js' ;
20- import { ForgeToolMetaTool } from './ForgeToolMetaTool.js' ;
19+ import type { ITool , ToolExecutionContext } from '../core/tools/ITool.js' ;
20+ import { ForgeToolMetaTool , type ForgeToolInput } from './ForgeToolMetaTool.js' ;
2121import { validateForgeShape } from './ForgeShapeValidator.js' ;
2222import { inferSchemaFromTestCases } from './ForgeSchemaInference.js' ;
2323
@@ -228,7 +228,15 @@ export function wrapForgeTool(options: WrapForgeToolOptions): ITool {
228228 } ,
229229 } ;
230230 try {
231- const r = await raw . execute ( fixed , patched as never ) ;
231+ // Cast is intentional: the wrapper's job is to normalize
232+ // arbitrary LLM output into something the engine can handle.
233+ // By this point `fixed` is shape-validated enough to run; TS
234+ // cannot statically prove it matches every ForgeToolInput
235+ // field because the source is untyped LLM output.
236+ const r = await raw . execute (
237+ fixed as unknown as ForgeToolInput ,
238+ patched as unknown as ToolExecutionContext ,
239+ ) ;
232240 const out = r . output as { verdict ?: { approved ?: boolean ; confidence ?: number ; reasoning ?: string } ; testResults ?: unknown ; result ?: unknown ; error ?: unknown } | undefined ;
233241 const verdict = out ?. verdict ?? { } ;
234242 // Judge confidence is the judge's score for whether the tool is
You can’t perform that action at this time.
0 commit comments