improve error message when tool id not matched

This commit is contained in:
Nate 2025-05-01 19:47:25 -07:00
parent 5ea59c9db0
commit 376f0e7a81

View file

@ -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}"`,
);
}
}