bug: generation just stops midway through a response
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
},
})
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
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
}
},
experiencing the same with gemini-2.5-pro
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.