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

bug: generation just stops midway through a response

Open theahura opened this issue 8 months ago • 2 comments

Describe the bug

I requested avante make several changes to 5 files at the same time, using the new gemini 2.5 pro model. The model made a plan and starting outputting code, before just freezing mid-stream. No matter how long I wait, it does not resume. If I quit out of the avante side bar, the chat and all of the generated code disappear.

To reproduce

I'm not really sure what is causing the bug, and I can't easily share the code I'm working with. However, I can say that it consistently stops in the same place if I am trying to edit the same five files with the same input prompt. It seems like it outputs ~4000 tokens before stopping, consistently.

Expected behavior

I expect the generation to continue unimpeded, or for there to be some kind of warning / error message if I am hitting rate limits or token limits.

Installation method

Use lazy.nvim:

{
  "yetone/avante.nvim",
  event = "VeryLazy",
  lazy = false,
  version = false, -- set this if you want to always pull the latest change
  opts = {
    -- add any opts here
  },
  -- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
  build = "make",
  -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
  dependencies = {
    "nvim-treesitter/nvim-treesitter",
    "stevearc/dressing.nvim",
    "nvim-lua/plenary.nvim",
    "MunifTanjim/nui.nvim",
  },
}

Environment

nvim 0.10.2 Ubuntu 20.04

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
  },
})

theahura avatar Apr 02 '25 22:04 theahura

Have you made sure that the selected model has max_tokens set > 4096? This was an issue I had originally as well but increasing that solved it. @theahura

felixnorden avatar Apr 07 '25 18:04 felixnorden

Yep, here is my opts settings:

    opts = {
      provider = "gemini",
      debug = true,
      behaviour = {
        auto_suggestions = false,
        minimize_diff = false
      },
      claude = {
        disable_tools = true, -- disable tools!
      },
      gemini = {
        model = "gemini-2.5-pro-exp-03-25",
        max_tokens = 1000000
      }
    },

theahura avatar Apr 07 '25 18:04 theahura

experiencing the same with gemini-2.5-pro

clotodex avatar Apr 16 '25 12:04 clotodex

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 May 17 '25 02:05 github-actions[bot]

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

github-actions[bot] avatar May 22 '25 02:05 github-actions[bot]