You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
After the neovim process ends, the opencode serve process does not close accordingly #251
Every time I open and close neovim, an opencode serve process spawned by this plugin is left running, which causes excessive memory usage. It seems the only solution is to manually terminate the opencode serve process.
I'm not sure if this is intented behavior or a bug. Can the same opencode serve be reused by multiple neovim instances?
I tried to monitor the spawned opencode process (using btop), and apparently the spawned process had a child process.
And when I exit neovim, the cleanup function only kill the parent process, leaving the child process orphaned.
Activity
sudo-tee commentedon Feb 7, 2026
Thanks for the report.
This is a puzzling issue as it does not happen to everyone and I am not able to reproduce it yet
I will have another look
I might need some help debugging it.
fix(server): improve shutdown sequence to ensure reliable job termina…
sudo-tee commentedon Feb 9, 2026
@widdsun
I played with the shutdown of the server in a PR, please let me know if it resolves the issue for you. As I was not experiencing this issue
#255
pirey commentedon Feb 10, 2026
@sudo-tee while I tried the branch, I found out this particular issue still persists
the
opencode serveprocess was not killed after exit, and opening neovim will spawn another process.Screen.Recording.2026-02-10.at.08.28.34.mp4
sudo-tee commentedon Feb 10, 2026
What OS are you using?
Do you have a link to your dotfiles ?
I seriously don't know why it's happening but only for few people
pirey commentedon Feb 10, 2026
I am using macos running neovim nightly release.
here's my dotfiles and neovim config
https://github.com/pirey/dotfiles/tree/master/config-files/home
https://github.com/pirey/nvim
fix(server): improve shutdown sequence to ensure reliable job termina…
sudo-tee commentedon Feb 10, 2026
@pirey @widdsun
I simplified the shutdown logic to the minimum and added some logging
you can enable it in your config
{ logging { enabled = true, level = 'debug' } }Could you do me a favor and enable the log even if it works for you so I can see if there is an error in one of the SIGTERM or SIGKILL ?
file path should be
~/.local/state/nvim/opencode.logThank you very much
pirey commentedon Feb 10, 2026
I found something. @sudo-tee
I tried to monitor the spawned opencode process (using btop), and apparently the spawned process had a child process.
And when I exit neovim, the cleanup function only kill the parent process, leaving the child process orphaned.
Screen.Recording.2026-02-10.at.21.33.34.mov
Here's a screenshot with the full command
pirey commentedon Feb 10, 2026
Here's the log file that you mentioned.
I cleared some earlier logs, though. I opened and close neovim and opencode several times after that.
sudo-tee commentedon Feb 10, 2026
@pirey
Thanks for the clarification.
I added a check for child process before killing it.
Let me know it it works properly for you now
pirey commentedon Feb 10, 2026
Hey thanks.
I can confirm that the spawned process and its child has been terminated now.
Works well on my end.
Screen.Recording.2026-02-10.at.23.33.10.mov
sudo-tee commentedon Feb 10, 2026
Awesome it looks like it solves your other issue at the same time.
I will merge this :)
fix(server): improve shutdown sequence to ensure reliable job termina…
Dimfred commentedon May 5, 2026
I don't know how it is for others, but I seem to still experience those issues.
Running this on exit now which seems to work: