From 03e1f5dc6dc12a0128dcff3f2a0b8cb128bf04a8 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Wed, 31 Dec 2025 15:04:45 +0300 Subject: Fix: mistral wants tool call id to be len 9 --- bot.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot.go b/bot.go index d09fa63..e8a40a7 100644 --- a/bot.go +++ b/bot.go @@ -873,7 +873,8 @@ func findCall(msg, toolCall string, tv *tview.TextView) { // we got here => last msg recognized as a tool call (correct or not) // make sure it has ToolCallID if chatBody.Messages[len(chatBody.Messages)-1].ToolCallID == "" { - chatBody.Messages[len(chatBody.Messages)-1].ToolCallID = randString(6) + // Tool call IDs should be alphanumeric strings with length 9! + chatBody.Messages[len(chatBody.Messages)-1].ToolCallID = randString(9) } // Ensure lastToolCall.ID is set, fallback to assistant message's ToolCallID if lastToolCall.ID == "" { -- cgit v1.2.3