Skip to content

bug: ACP provider crashes sidebar when include_model = true #2995

@jonas0616

Description

@jonas0616

Describe the bug

When using `avante.nvim with an ACP provider, opening the Avante sidebar crashes if the following option is enabled:

windows = {
  sidebar_header = {
    include_model = true,
  }
}

Error message:

E5108: Error executing lua: ...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:1006: attempt to index a nil value
stack traceback:
	...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:1006: in function 'render_header'
	...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:1045: in function 'render_result'
	...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:1479: in function 'on_mount'
	...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:3249: in function 'render'
	...local/share/nvim/lazy/avante.nvim/lua/avante/sidebar.lua:179: in function 'open'
	...s/.local/share/nvim/lazy/avante.nvim/lua/avante/init.lua:445: in function 'open_sidebar'
	...as/.local/share/nvim/lazy/avante.nvim/lua/avante/api.lua:157: in function 'ask'
	...s/.local/share/nvim/lazy/avante.nvim/lua/avante/init.lua:137: in function <...s/.local/share/nvim/lazy/avante.nvim/lua/avante/init.lua:137>

To reproduce

  1. Configure avante.nvim to use an ACP provider
  2. Enable the following option:
windows = {
  sidebar_header = {
    include_model = true,
  }
}
  1. Open Neovim.
  2. Open the Avatne sidebar (:AvanteAsk)
  3. Observe the error.

Expected behavior

The Avante sidebar should open normally.

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 = {
		provider = "copilot-cli",
		acp_providers = {
			["copilot-cli"] = {
				command = "copilot",
				-- https://docs.github.com/en/copilot/reference/acp-server
				args = {
					"--acp",
					"--stdio",
					"--allow-all-tools",
					"--deny-tool",
					"shell(git push)",
					"--model",
					"gpt-5.4",
				},
			},
		},
		windows = {
			sidebar_header = {
				include_model = true,
			},
		},
	},
	-- 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-lua/plenary.nvim",
		"MunifTanjim/nui.nvim",
		"zbirenbaum/copilot.lua",
	},
}

Environment

NVIM v0.11.6
Ubuntu 24.04.4 LTS

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 = {
		-- { "LazyVim/LazyVim", import = "lazyvim.plugins" },
		{
			"yetone/avante.nvim",
			event = "VeryLazy",
			lazy = false,
			version = false, -- set this if you want to always pull the latest change
			opts = {
				provider = "copilot-cli",
				acp_providers = {
					["copilot-cli"] = {
						command = "copilot",
						-- https://docs.github.com/en/copilot/reference/acp-server
						args = {
							"--acp",
							"--stdio",
							"--allow-all-tools",
							"--deny-tool",
							"shell(git push)",
							"--model",
							"gpt-5.4",
						},
					},
				},
				windows = {
					sidebar_header = {
						include_model = true,
					},
				},
			},
			-- 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-lua/plenary.nvim",
				"MunifTanjim/nui.nvim",
				"zbirenbaum/copilot.lua",
			},
		},
	},
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions