fix: prevent Tool.define() wrapper accumulation on object-defined tools (#16952)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
eb6f1dada8
commit
81d3ac3bf0
@@ -55,7 +55,7 @@ export namespace Tool {
|
||||
return {
|
||||
id,
|
||||
init: async (initCtx) => {
|
||||
const toolInfo = init instanceof Function ? await init(initCtx) : init
|
||||
const toolInfo = init instanceof Function ? await init(initCtx) : { ...init }
|
||||
const execute = toolInfo.execute
|
||||
toolInfo.execute = async (args, ctx) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user