Description
I was working on some Neovim config files when my laptop suddenly became extremely sluggish - like completely unusable. At first I thought it was a power management issue, but when I checked my processes, I found three ripgrep processes that had been running for almost 3 hours, each consuming around 230% CPU (680% total).
The commands OpenCode spawned were:
/usr/bin/rg --files --glob=!.git/* --follow --hidden --glob=**/*nvim*
/usr/bin/rg --files --glob=!.git/* --follow --hidden --glob=**/.config/nvim/**/*.lua
/usr/bin/rg --files --glob=!.git/* --follow --hidden --glob=**/.config/nvim/**/*.vim
All three just ran indefinitely and never completed. My system load hit 31 (should be under 8 for my 8-core CPU).
The problem seems to be:
- Overly broad glob patterns -
**/*nvim* matches 61,000+ files in my home directory
- The
--follow flag - I have symlinks in my nvim config, and following them causes massive directory traversal
- through my
~/.local/share/nvim/lazy/ plugins folder (594 subdirectories, 255MB)
- No timeout - The processes just run forever with no resource limits
- Searching entire home directory instead of just the workspace
This has happened twice now. I have to manually kill the processes with kill -9 to get my system responsive again.
Plugins
@modelcontextprotocol/server-filesystem - @modelcontextprotocol/server-github - @modelcontextprotocol/server-postgres - @modelcontextprotocol/server-brave-search
OpenCode version
1.1.25
Steps to reproduce
- Have a Neovim config directory with lazy.nvim plugins (~/.config/nvim and ~/.local/share/nvim/lazy with lots of plugins)
- Include at least one symlink in the nvim config (mine is
~/.config/nvim/lua/plugins/theme.lua → ~/.config/omarchy/current/theme/neovim.lua)
- Open or edit files in the nvim config directory with OpenCode
- Wait a few minutes - OpenCode will spawn ripgrep processes that never finish
- Check
htop or ps aux --sort=-%cpu to see multiple rg processes consuming massive CPU
Screenshot and/or share link
No response
Operating System
Arch Linux (Omarchy distribution) - kernel 6.12+
Terminal
kitty
Description
I was working on some Neovim config files when my laptop suddenly became extremely sluggish - like completely unusable. At first I thought it was a power management issue, but when I checked my processes, I found three ripgrep processes that had been running for almost 3 hours, each consuming around 230% CPU (680% total).
The commands OpenCode spawned were:
All three just ran indefinitely and never completed. My system load hit 31 (should be under 8 for my 8-core CPU).
The problem seems to be:
**/*nvim*matches 61,000+ files in my home directory--followflag - I have symlinks in my nvim config, and following them causes massive directory traversal~/.local/share/nvim/lazy/plugins folder (594 subdirectories, 255MB)This has happened twice now. I have to manually kill the processes with
kill -9to get my system responsive again.Plugins
@modelcontextprotocol/server-filesystem - @modelcontextprotocol/server-github - @modelcontextprotocol/server-postgres - @modelcontextprotocol/server-brave-search
OpenCode version
1.1.25
Steps to reproduce
~/.config/nvim/lua/plugins/theme.lua→~/.config/omarchy/current/theme/neovim.lua)htoporps aux --sort=-%cputo see multiplergprocesses consuming massive CPUScreenshot and/or share link
No response
Operating System
Arch Linux (Omarchy distribution) - kernel 6.12+
Terminal
kitty