avante.nvim icon indicating copy to clipboard operation
avante.nvim copied to clipboard

bug: Creates new file instead of applying to the current one

Open YourSandwich opened this issue 1 year ago • 6 comments

Describe the bug

Avante is always creating new fills when trying to apply changes instead of merging them with the current file: image

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

YourSandwich avatar Nov 02 '24 05:11 YourSandwich

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

YourSandwich avatar Nov 02 '24 05:11 YourSandwich

I second this issue, in my case, in MacOS!

Qkessler avatar Nov 09 '24 23:11 Qkessler

Same issue on ollama local MacOS

monkeyxite avatar Dec 05 '24 17:12 monkeyxite

Same issue with Copilot on MacOS. It used to work until a week ago or so.

mragab avatar Dec 15 '24 14:12 mragab

Having the same issue

HPRIOR avatar Jan 18 '25 09:01 HPRIOR

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.

github-actions[bot] avatar Apr 03 '25 02:04 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Apr 10 '25 02:04 github-actions[bot]