From 376f0e7a815589430e89edfa1583f4ed2febdaff Mon Sep 17 00:00:00 2001 From: Nate Date: Thu, 1 May 2025 19:47:25 -0700 Subject: [PATCH] improve error message when tool id not matched --- core/llm/countTokens.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/llm/countTokens.ts b/core/llm/countTokens.ts index 218343538..9d2eb2ada 100644 --- a/core/llm/countTokens.ts +++ b/core/llm/countTokens.ts @@ -355,7 +355,7 @@ function compileChatMessages({ lastToolCallsMsg = msgsCopy.pop(); if (!messageHasToolCallId(lastToolCallsMsg, lastUserOrToolMsg.toolCallId)) { throw new Error( - `Error parsing chat history: tool call found to match tool output for id ${lastUserOrToolMsg.toolCallId}`, + `Error parsing chat history: no tool call found to match tool output for id "${lastUserOrToolMsg.toolCallId}"`, ); } }