From 9efb9e1029a6e1ca56842e988da4502222d88b2b Mon Sep 17 00:00:00 2001 From: yetone Date: Thu, 5 Jun 2025 00:06:49 +0800 Subject: [PATCH] fix: attempt_completion ignore open command (#2151) --- lua/avante/llm_tools/attempt_completion.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/avante/llm_tools/attempt_completion.lua b/lua/avante/llm_tools/attempt_completion.lua index eb91a12..318b510 100644 --- a/lua/avante/llm_tools/attempt_completion.lua +++ b/lua/avante/llm_tools/attempt_completion.lua @@ -72,7 +72,8 @@ function M.func(opts, on_log, on_complete, session_ctx) local sidebar = require("avante").get() if not sidebar then return false, "Avante sidebar not found" end session_ctx.attempt_completion_is_called = true - if opts.command and opts.command ~= "" and opts.command ~= vim.NIL then + if opts.command and opts.command ~= vim.NIL and opts.command ~= "" and not vim.startswith(opts.command, "open ") then + session_ctx.always_yes = false require("avante.llm_tools.bash").func({ command = opts.command }, on_log, on_complete, session_ctx) else on_complete(true, nil)