tweak: move zod validation for tools to ensure it always runs (#3565)
parent
149f5eaa2e
commit
dc87659791
|
|
@ -534,7 +534,6 @@ export namespace SessionPrompt {
|
|||
args,
|
||||
},
|
||||
)
|
||||
item.parameters.parse(args)
|
||||
const result = await item.execute(args, {
|
||||
sessionID: input.sessionID,
|
||||
abort: options.abortSignal!,
|
||||
|
|
|
|||
|
|
@ -42,8 +42,13 @@ export namespace Tool {
|
|||
return {
|
||||
id,
|
||||
init: async () => {
|
||||
if (init instanceof Function) return init()
|
||||
return init
|
||||
const toolInfo = init instanceof Function ? await init() : init
|
||||
const execute = toolInfo.execute
|
||||
toolInfo.execute = (args, ctx) => {
|
||||
toolInfo.parameters.parse(args)
|
||||
return execute(args, ctx)
|
||||
}
|
||||
return toolInfo
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue