Treat AI empty tool call as empty object

This commit is contained in:
Alex Gleason committed 2025-09-12 10:34:38 -05:00
1 parent e92b3b9cd4
commit 266774fc61
1 file changed
+1 -1
+1 -1
View File
@@ -329,7 +329,7 @@ export class SessionManager {
try {
let toolArgs: unknown;
if (tool.inputSchema) {
toolArgs = tool.inputSchema.parse(JSON.parse(functionToolCall.function.arguments));
toolArgs = tool.inputSchema.parse(JSON.parse(functionToolCall.function.arguments || '{}'));
} else {
// For tools without inputSchema, use empty object or parsed arguments as-is
const rawArgs = functionToolCall.function.arguments;