fix(useToolCalls): handle null parsedArgs gracefully (#1747)

This commit is contained in:
Hexqi 2026-01-20 20:01:59 +08:00 committed by GitHub
parent 47f636c86f
commit 1037e3cfb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ export const callTools = async (tool_calls: any, hooks: CallToolHooks, signal: A
const result = []
for (const tool of tool_calls) {
const { name, arguments: args } = tool.function
const parsedArgs = parseArgs(args)
const parsedArgs = parseArgs(args) ?? {}
tool.parsedArgs = parsedArgs
tool.name = name