From 5c501600cd13f032a08b0aaf25a7bb309a910c09 Mon Sep 17 00:00:00 2001 From: Chris Estreich Date: Thu, 4 Dec 2025 23:06:58 -0800 Subject: [PATCH] Better error logs for parseToolCall exceptions (#9857) --- 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 ac616e89f3..f02bb8003b 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 } }