Neovim version: 0.11.6
Operating system/version: macOS 26.3.1
Describe the bug:
The system strategy crashes with "Invalid buffer id" errors when a task's output buffer is closed/wiped while the task is still running or finishing. Two vim.schedule callbacks in strategy/system.lua access self.bufnr without checking buffer validity:
- Line 115 —
on_output calls vim.api.nvim_buf_line_count(self.bufnr)
- Line 213 — exit handler sets
vim.bo[self.bufnr].modifiable = true
PR #415 (commit 100e969) fixed similar issues in util.lua but these call sites were not covered.
Error executing vim.schedule lua callback: .../overseer/strategy/system.lua:115: Invalid buffer id: 2
stack traceback:
[C]: in function 'nvim_buf_line_count'
.../overseer/strategy/system.lua:115: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Error executing vim.schedule lua callback: .../overseer/strategy/system.lua:213: Invalid buffer id: 3
stack traceback:
[C]: in function '__newindex'
.../overseer/strategy/system.lua:213: in function <.../overseer/strategy/system.lua:209>
Severity: tolerable (can work around it)
Steps To Reproduce:
- Run a task using the
system strategy
- Close/wipe the task output buffer while the task is still running or finishing
- Errors appear as the
vim.schedule callbacks fire on the now-invalid buffer
Expected Behavior:
Callbacks should check vim.api.nvim_buf_is_valid(self.bufnr) and return early if the buffer has been wiped, similar to the guards added in #415.
Neovim version: 0.11.6
Operating system/version: macOS 26.3.1
Describe the bug:
The
systemstrategy crashes with "Invalid buffer id" errors when a task's output buffer is closed/wiped while the task is still running or finishing. Twovim.schedulecallbacks instrategy/system.luaaccessself.bufnrwithout checking buffer validity:on_outputcallsvim.api.nvim_buf_line_count(self.bufnr)vim.bo[self.bufnr].modifiable = truePR #415 (commit
100e969) fixed similar issues inutil.luabut these call sites were not covered.Severity: tolerable (can work around it)
Steps To Reproduce:
systemstrategyvim.schedulecallbacks fire on the now-invalid bufferExpected Behavior:
Callbacks should check
vim.api.nvim_buf_is_valid(self.bufnr)and return early if the buffer has been wiped, similar to the guards added in #415.