bug: Creates new file instead of applying to the current one
Describe the bug
Avante is always creating new fills when trying to apply changes instead of merging them with the current file:
Using the Edit function works as expected.
I am using Ollama as provider and the qwen2.5-coder:7B model, other models have the same issue
To reproduce
Run AventeAsk and tell the LLM to write any function. Try to apply the codeblock, and see that a new buffer was opened instead.
Expected behavior
No response
Installation method
Use lazy.nvim:
return {
{
"yetone/avante.nvim",
event = "VeryLazy",
lazy = false,
version = false,
opts = {
provider = "ollama",
vendors = {
ollama = {
["local"] = true,
endpoint = "127.0.0.1:11434/v1",
model = "qwen2.5-coder:7b-instruct-q8_0",
parse_curl_args = function(opts, code_opts)
return {
url = opts.endpoint .. "/chat/completions",
headers = {
["Accept"] = "application/json",
["Content-Type"] = "application/json",
},
body = {
model = opts.model,
messages = require("avante.providers").copilot.parse_message(code_opts), -- Advanced custom message parsing
max_tokens = 16384,
stream = true,
},
}
end,
parse_response_data = function(data_stream, event_state, opts)
require("avante.providers").openai.parse_response(data_stream, event_state, opts)
end,
},
},
},
build = "make",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"stevearc/dressing.nvim",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
},
},
}
Environment
OS: Arch Linux x86_64
NVIM: v0.10.2
Terminal: kitty 0.37.0
Linux BORKEN 6.12.0-rc5-273-tkg-eevdf #1 SMP PREEMPT_DYNAMIC TKG Mon, 28 Oct 2024 21:00:49 +0000 x86_64 GNU/Linux
Repro
No response
Applying changes to a non-empty file sometimes works with the Ask feature, but sometimes the LLM seems to not load the buffer into its context
I second this issue, in my case, in MacOS!
Same issue on ollama local MacOS
Same issue with Copilot on MacOS. It used to work until a week ago or so.
Having the same issue
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.
This issue was closed because it has been stalled for 5 days with no activity.