From 1e82a1c0e7e9e5b41ced1619c8161a0a6e50e72b Mon Sep 17 00:00:00 2001 From: yetone Date: Thu, 13 Mar 2025 16:53:50 +0800 Subject: [PATCH] fix: do not use bash to write file! (#1576) --- lua/avante/llm_tools.lua | 2 +- lua/avante/templates/_tools-guidelines.avanterules | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/avante/llm_tools.lua b/lua/avante/llm_tools.lua index b14f605..e06de58 100644 --- a/lua/avante/llm_tools.lua +++ b/lua/avante/llm_tools.lua @@ -1101,7 +1101,7 @@ M._tools = { }, { name = "bash", - description = "Run a bash command in a directory. Can't use search commands like find/grep or read tools like cat/ls.", + description = "Run a bash command in a directory. Can't use search commands like find/grep or read tools like cat/ls. Can't use it to read files or modify files.", param = { type = "table", fields = { diff --git a/lua/avante/templates/_tools-guidelines.avanterules b/lua/avante/templates/_tools-guidelines.avanterules index f0c3018..f17d2d4 100644 --- a/lua/avante/templates/_tools-guidelines.avanterules +++ b/lua/avante/templates/_tools-guidelines.avanterules @@ -18,3 +18,4 @@ Tools Usage Guide: - After `web_search` tool returns, if you don't get detailed enough information, do not continue use `web_search` tool, just continue using the `fetch` tool to get more information you need from the links in the search results. - For any mathematical calculation problems, please prioritize using the `python` tool to solve them. Please try to avoid mathematical symbols in the return value of the `python` tool for mathematical problems and directly output human-readable results, because large models don't understand mathematical symbols, they only understand human natural language. - Do not use the `python` tool to read or modify files! If you use the `python` tool to read or modify files, you will be fired!!!!! + - Do not use the `bash` tool to read or modify files! If you use the `bash` tool to read or modify files, you will be fired!!!!!