Skip empty tool calls returned by gpt-5 on OpenRouter Fixes #4370

733bf1ecd9ad17639dc921b9dd6583f23c38ba33

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +1 -1Showing whitespace changes
public/scripts/tool-calling.js+1 -1
@@ -724,7 +724,7 @@ export class ToolManager {
724 }724 }
725725
726 for (const toolCall of toolCalls) {726 for (const toolCall of toolCalls) {
727 if (typeof toolCall.function !== 'object') {727 if (!toolCall || !toolCall.function || typeof toolCall.function !== 'object') {
728 continue;728 continue;
729 }729 }
730730