From 340d298c47c972a554ada7e223f0bee793fc626e Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 26 Mar 2025 15:27:07 +0800 Subject: [PATCH] fix: dispatch agent (#1725) --- lua/avante/llm.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lua/avante/llm.lua b/lua/avante/llm.lua index 652984e..6ebfc46 100644 --- a/lua/avante/llm.lua +++ b/lua/avante/llm.lua @@ -557,8 +557,13 @@ function M._stream(opts) return handle_next_tool_use(tool_use_list, tool_use_index + 1, tool_histories) end -- Either on_complete handles the tool result asynchronously or we receive the result and error synchronously when either is not nil - local result, error = - LLMTools.process_tool_use(opts.tools, tool_use, opts.on_tool_log, handle_tool_result, opts.session_ctx) + local result, error = LLMTools.process_tool_use( + prompt_opts.tools, + tool_use, + opts.on_tool_log, + handle_tool_result, + opts.session_ctx + ) if result ~= nil or error ~= nil then return handle_tool_result(result, error) end end if stop_opts.reason == "cancelled" then