From bf3c210584cff2f43aa90ca0156a982348ef0ea7 Mon Sep 17 00:00:00 2001 From: yetone Date: Thu, 17 Jul 2025 17:05:16 +0800 Subject: [PATCH] fix: assistant message content must be a string --- lua/avante/history/init.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lua/avante/history/init.lua b/lua/avante/history/init.lua index 174160f..3e43ca1 100644 --- a/lua/avante/history/init.lua +++ b/lua/avante/history/init.lua @@ -215,14 +215,13 @@ M.update_history_messages = function(messages, using_ReAct_prompt, add_diagnosti table.insert( picked_messages, 1, - Message:new_assistant_synthetic({ - type = "text", - text = string.format( + Message:new_assistant_synthetic( + string.format( "Tool use %s(%s)", tool_use_message.message.content[1].name, vim.json.encode(tool_use_message.message.content[1].input) - ), - }) + ) + ) ) end elseif Helpers.is_tool_use_message(msg) then