Fix generation looping
| @@ -459,7 +459,8 @@ export class ToolManager { | |||
| 459 | * @returns {boolean} Whether the response data contains tool calls | 459 | * @returns {boolean} Whether the response data contains tool calls |
| 460 | */ | 460 | */ |
| 461 | static hasToolCalls(data) { | 461 | static hasToolCalls(data) { |
| 462 | return Array.isArray(ToolManager.#getToolCallsFromData(data)); | 462 | const toolCalls = ToolManager.#getToolCallsFromData(data); |
| 463 | return Array.isArray(toolCalls) && toolCalls.length > 0; | ||
| 463 | } | 464 | } |
| 464 | 465 | ||
| 465 | /** | 466 | /** |