Commit Graph

112 Commits

Author SHA1 Message Date
Yomi Colledge
f4f82a09d7 fix(llm_tools): Improve the permissions logic (#2506)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2025-07-22 17:54:46 +08:00
Dmitry Torokhov
aa606b6147 refactor(history): change HistoryMessage:new() to accept role and item
Change the constructor to accept role and a single content item instead
of raw AvanteLLMMessage instance. This will help when we will start
changing message.content from being a string or a list of tables to just
a string or a single table.
2025-07-22 17:49:28 +08:00
Dmitry Torokhov
86e8563125 refactor(llm_tools): use History.Helpers.get_tool_result_data()
Avoid poking into internals of avante.HistoryMessage, and use
appropriate helper instead.
2025-07-22 17:49:28 +08:00
Dmitry Torokhov
e82b159f65 refactor(history): add a helper to fetch text from messages and use it
This adds History.Helpers.get_text_data() helper to fetch contents of a
"text" message. This removes the need to know internals of message
structure outside of history module.
2025-07-22 17:49:28 +08:00
yetone
27a88c095f fix: incorrect diff (#2500) 2025-07-21 23:59:12 +08:00
Dmitry Torokhov
7d60b51324 refactor(sidebar): move sub-windows into a table
Maintaining secondary table of window IDs is cumbersome and is prone to
getting out of sync with the true state of the sidebar. In preparation
for removal of winids table move all containers (sub-windows of the
sidebar) into "containers" table.

The change is mostly mechanical rename with following exceptions:

 - Sidebar:reifresh_winids() and other places where the code scanned
   entire Sidebar object looking for tables with specific fields, such
   as "winid", or "mount" needed to be adjusted for the new structure

 - Sidebar:new() and Sidebar:reset() have been adjusted to make better
   use of the new sub-table.
2025-07-21 13:31:07 +08:00
yetone
2d0b6875dd chores: refine top-level-symbols prompts 2025-07-21 13:22:40 +08:00
yetone
75ebef9fbe fix: tool_info is nil 2025-07-21 11:50:55 +08:00
yetone
b4c9246461 fix: find symbol definition ool 2025-07-17 20:37:57 +08:00
yetone
1dc195d9ef fix: edit_file cannot find old str 2025-07-17 19:49:08 +08:00
yetone
cd81fbf8af fix: tool_use_id is nil 2025-07-17 14:29:17 +08:00
yetone
5ea24f59fa fix: clear useless parameters 2025-07-17 13:50:33 +08:00
yetone
2a16e7d4d9 fix: do not modify the tool_use input 2025-07-16 20:18:24 +08:00
yetone
adbd296ba6 feat: integrated morph 2025-07-16 18:34:52 +08:00
Dmitry Torokhov
b64120749f refactor(history): use get_tool_(result|use_data)() in dispatch_agent.lua
Using these helpers simplifies the code and provides better
encapsulation.
2025-07-16 12:49:15 +08:00
Dmitry Torokhov
47ad90b389 fix: when deleting tool use also delete tool result
Tool results are not useful without their "use" messages, so delete them
when deleting "use" ones.

Makes use of the new get_tool_use_data() and get_tool_result_data()
helpers.
2025-07-16 12:49:15 +08:00
Dmitry Torokhov
34907fc1cd refactor(history): start moving history-related code into avante/history
The utils module has grown too big and contains unrelated functionality.
Start moving code related to managing history messages comprising chat
history into lua/avante/history module to keep the code more manageable.
2025-07-16 12:49:15 +08:00
yetone
127a12a878 fix: trim escapes for write_to_file tool (#2455) 2025-07-16 12:04:22 +08:00
yetone
154e5f578f feat: add timeout for bash tool (#2451) 2025-07-15 20:46:15 +08:00
yetone
b8bb0fd969 refactor: llm tool parameters (#2449) 2025-07-15 16:40:25 +08:00
Raul Luzetti
e06f55d353 fix(replace_in_file): added a replace substring logic (#2438) 2025-07-14 10:14:16 +08:00
yetone
14cfccdba9 fix: do not use str_replace_editor (#2428) 2025-07-10 10:17:48 +08:00
yetone
935234981b fix: missing new_str (#2407) 2025-07-04 00:38:17 +08:00
yetone
9bc5bf8053 fix: breaklines (#2403) 2025-07-03 14:43:44 +08:00
yetone
203861bb71 feat: init project (#2395) 2025-07-02 18:44:30 +08:00
yetone
1a6d1d6af4 fix: the content is table (#2394) 2025-07-02 17:09:46 +08:00
yetone
66c3b6665c fix: add missing session-ctx (#2393) 2025-07-02 16:58:15 +08:00
guanghechen
f523710e95 fix(#1939): fix the logic of ignore-checking, prefer to call the git check-ignore for git repos (#2383) 2025-07-01 17:19:17 +08:00
Peter Cardenas
bc96007c76 fix: get_bufnr errors on edited file (#2374) 2025-06-30 18:53:22 +08:00
Peter Cardenas
fb71d5d5c6 fix: get diagnostics tool (#2357) 2025-06-28 20:08:47 +08:00
yetone
04aeb3caf4 fix: the edge case in replace_in_file (#2351) 2025-06-27 15:46:45 +08:00
yetone
7738503c1d fix: open buffer (#2340) 2025-06-26 16:52:23 +08:00
yetone
0e732d194b fix: write path (#2338) 2025-06-26 16:18:10 +08:00
yetone
07b703dbd5 fix: ReAct parser (#2330) 2025-06-25 16:55:10 +08:00
yetone
aa4fa9c89d fix: refine attempt_completion prompts (#2320) 2025-06-24 19:15:49 +08:00
yetone
3033556d5b fix: tool calling (#2297) 2025-06-22 21:50:26 +08:00
yetone
7b36aa828b fix: create parent dir (#2296) 2025-06-22 15:46:16 +08:00
yetone
30fab46ca1 fix: compact memory (#2278) 2025-06-21 00:55:36 +08:00
yetone
babb114bc4 fix: swap diff incoming and deleting (#2273) 2025-06-20 14:26:02 +08:00
yetone
25be666377 fix: respect the minimize_diff configuration (#2267) 2025-06-19 17:26:19 +08:00
yetone
5f0c2f1252 fix: clear hints (#2265) 2025-06-19 15:09:58 +08:00
yetone
b558408b5b fix: avoid freeze confirmation window (#2255) 2025-06-18 15:12:16 +08:00
yetone
2ed75a2f97 refactor: rename thinking => think (#2247) 2025-06-17 14:08:03 +08:00
Andre-Philippe Paquet
59ad32efcf fix: don’t execute incomplete streaming commands (#2245) 2025-06-17 10:56:58 +08:00
yetone
320bf2cee1 fix: remove the_diff argument (#2246) 2025-06-17 10:36:31 +08:00
yetone
e8aae6c1dd fix: copilot replace_in_file example (#2239)
Co-authored-by: Andre-Philippe Paquet <appaquet@gmail.com>
2025-06-16 20:40:19 +08:00
yetone
b390bb06e7 fix: check path is nil (#2235) 2025-06-16 12:13:39 +08:00
yetone
9e074998ee fix: command not provided (#2231) 2025-06-16 01:30:00 +08:00
yetone
fcf457ed7f fix: refine tools (#2229) 2025-06-16 01:27:39 +08:00
yetone
ad05a802f9 feat: todos (#2184) 2025-06-15 15:10:07 +08:00