From 02aa0a42416f4339bc693eb5ca236f0daa70e067 Mon Sep 17 00:00:00 2001 From: yetone Date: Thu, 24 Jul 2025 16:44:05 +0800 Subject: [PATCH] fix: compatible with some incorrect tool results (#2530) --- lua/avante/llm_tools/dispatch_agent.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/avante/llm_tools/dispatch_agent.lua b/lua/avante/llm_tools/dispatch_agent.lua index cc248f9..acb221d 100644 --- a/lua/avante/llm_tools/dispatch_agent.lua +++ b/lua/avante/llm_tools/dispatch_agent.lua @@ -131,7 +131,7 @@ function M.on_render(input, opts) summary = string.format("View %s: failed", path) else local ok, result = pcall(vim.json.decode, tool_result.content) - if ok then + if ok and type(result) == "table" and type(result.content) == "string" then local lines = vim.split(result.content, "\n") summary = string.format("View %s: %d lines", path, #lines) end