From 34e7ab5885dc56a630612cb0c54af98f23b94c82 Mon Sep 17 00:00:00 2001 From: cte Date: Thu, 4 Dec 2025 22:31:46 -0800 Subject: [PATCH] Better error logs for parseToolCall exceptions --- src/core/assistant-message/NativeToolCallParser.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/assistant-message/NativeToolCallParser.ts b/src/core/assistant-message/NativeToolCallParser.ts index ac616e89f33..f02bb8003bc 100644 --- a/src/core/assistant-message/NativeToolCallParser.ts +++ b/src/core/assistant-message/NativeToolCallParser.ts @@ -756,8 +756,11 @@ export class NativeToolCallParser { return result } catch (error) { - console.error(`Failed to parse tool call arguments:`, error) - console.error(`Error details:`, error instanceof Error ? error.message : String(error)) + console.error( + `Failed to parse tool call arguments: ${error instanceof Error ? error.message : String(error)}`, + ) + + console.error(`Tool call: ${JSON.stringify(toolCall, null, 2)}`) return null } }