From d1fa11ec41b2e06fc9686794b344e575ae024408 Mon Sep 17 00:00:00 2001 From: Omar Crespo Date: Thu, 20 Mar 2025 21:30:44 -0500 Subject: [PATCH] fix: claude-text-editor dont change the mod for other providers (#1656) --- lua/avante/sidebar.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/avante/sidebar.lua b/lua/avante/sidebar.lua index 0e22224..73d1ae9 100644 --- a/lua/avante/sidebar.lua +++ b/lua/avante/sidebar.lua @@ -2469,7 +2469,14 @@ function Sidebar:create_input_container(opts) local mode = "planning" if Config.behaviour.enable_cursor_planning_mode then mode = "cursor-planning" end - if Config.behaviour.enable_claude_text_editor_tool_mode then mode = "claude-text-editor-tool" end + + local provider_config = Config.get_provider_config(Config.provider) + local is_claude_model = provider_config + and provider_config.model + and (provider_config.model:lower():match("claude") or Config.provider:lower():match("claude")) + if Config.behaviour.enable_claude_text_editor_tool_mode and is_claude_model then + mode = "claude-text-editor-tool" + end ---@type AvanteGeneratePromptsOptions local prompts_opts = {