bug: Tool calls do not do anything
Describe the bug
Hi! I'm experiencing the same issue, that was described in #2635, but that ticket is already closed without any solution.
Haven't used Avante for several weeks, returned and also faced similar issue. Avante communicates with the model, gets answers, but just prints out jsons and does nothing. No errors in :messages while debug mode is enabled. Both on Qwen-coder and Deepseek.
I'll help you create a new Go test that executes the `<correct_cli_command>` command in a specific directory. Let me first check the current content of the test file to understand its structure.
json
{
"tool_calls": [
{
"type": "function",
"function": {
"name": "view",
"arguments": "{\"path\":\"<correct_path>/test/lib_test.go\"}"
}
}
]
}
Now I'll modify the test file to add a new test function that executes the `<correct_cli_command>` command in the specified directory.
json
{
"tool_calls": [
{
"type": "function",
"function": {
"name": "write_to_file",
"arguments": "{\"path\":\"<correct_path>/test/lib_test.go\",\"the_content\":\"package yt_monitoring_infractl_canonize\\n\\nimport (\\n\\t\\\"os/exec\\\"\\n\\t\\\"testing\\\"\\n\\t\\\"go/test/canon\\\"\\n)\\n\\ntype Dog struct {\\n\\tBreed string\\n\\tName string\\n\\tWeight float64\\n}\\n\\nfunc Test1(t *testing.T) {\\n\\tcanon.SaveJSON(t, Dog{\\\"korgi\\\", \\\"Charlie\\\", 10.432})\\n}\\n\\nfunc TestInfractlDiff(t *testing.T) {\\n\\tcmd := exec.Command(\\\"correct\\\", \\\"cli\\\", \\\"command\\\")\\n\\tcmd.Dir = \\\"<correct_path>\\\"\\n\\toutput, err := cmd.CombinedOutput()\\n\\tif err != nil {\\n\\t\\tt.Fatalf(\\\"Command failed: %v\\\\nOutput: %s\\\", err, output)\\n\\t}\\n\\tt.Logf(\\\"Command output: %s\\\", output)\\n}\"}"
}
}
]
}
json
{
"tool_calls": [
{
"type": "function",
"function": {
"name": "attempt_completion",
"arguments": "{\"result\":\"I've successfully added a new TestInfractlDiff function to the lib_test.go file. This test executes the 'ya tool infractl diff' command in the specified directory (<correct_path>) and properly handles the command output. The test will fail if the command fails and log the output otherwise.\"}"
}
}
]
}
To reproduce
No response
Expected behavior
Chat-bot hides inner jsons, makes change in my code and asks for permission to apply changes
Installation method
Use lazy.nvim:
{
"yetone/avante.nvim",
build = vim.fn.has("win32") ~= 0
and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false"
or "make",
event = "VeryLazy",
version = false, -- Never set this value to "*"! Never!
---@module 'avante'
---@type avante.Config
opts = {
provider = "qwencode",
providers = {
deepseek = {
__inherited_from = "openai",
api_key_name = "cmd:cat ~/.config/api_key",
endpoint = "https://<correct_url>/raw/internal/deepseek/v1",
model = "deepseek-0324",
},
qwencode = {
__inherited_from = "openai",
api_key_name = "cmd:cat ~/.config/api_key",
endpoint = "https://<correct_url>/raw/internal/qwen3-coder-480b-a35b-runtime/v1",
model = "qwen3-coder-480b-a35b-runtime",
},
},
},
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
--- The below dependencies are optional,
"nvim-telescope/telescope.nvim", -- for file_selector provider telescope
"hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
"ibhagwan/fzf-lua", -- for file_selector provider fzf
-- "stevearc/dressing.nvim", -- for input provider dressing
-- "folke/snacks.nvim", -- for input provider snacks
-- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
},
}
Environment
nvim: 0.11.4
Ubuntu 22.04.4 LTS
avante.nvim VeryLazy url https://github.com/yetone/avante.nvim branch main commit 4286ac9
Repro
vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
require("lazy.minit").repro({
spec = {
-- add any other plugins here
},
})
https://github.com/yetone/avante.nvim/issues/2240#issuecomment-3125059939
#2240 (comment)
Wow! That's unexpected. Did something change in the code of Avante about this? Because the same provider worked for me previously (in august). And what really means "weak" when there's already an answer from the provider and I already can see those json instructions, that just aren't being executed?`
But this param seems to be fixing my issue for now, so thanks a lot!
But this param seems to be fixing my issue for now, so thanks a lot!
Too early to party, it worked only once yesterday evening, but today it stopped applying changes again:( trying to find some places where can be cached, or any other helpful debug info
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.