Skip to content

Fix #1056: prevent macOS FD exhaustion by ignoring node_modules in skills watcher#1074

Merged
steipete merged 1 commit intoopenclaw:mainfrom
roshanasingh4:fix/1056-ignore-heavy-watch-paths
Jan 17, 2026
Merged

Fix #1056: prevent macOS FD exhaustion by ignoring node_modules in skills watcher#1074
steipete merged 1 commit intoopenclaw:mainfrom
roshanasingh4:fix/1056-ignore-heavy-watch-paths

Conversation

@roshanasingh4
Copy link
Copy Markdown
Contributor

Fixes #1056.

Problem

  • On macOS, chokidar can hold huge numbers of file descriptors when asked to watch deep dependency trees (notably node_modules).
  • Clawdbot starts a skills watcher per workspace; if the workspace contains large trees under the watched paths, FD exhaustion can cause child_process.spawn to fail with spawn EBADF, breaking tool execution.

Fix

  • The skills watcher only needs to react to skill changes, so add default ignored patterns to skip dotfiles (incl. .git), node_modules, and dist.

Tests

  • Add src/agents/skills/refresh.test.ts asserting the watcher is configured with the ignore patterns.

On macOS, watching deep dependency trees can exhaust file descriptors and lead to spawn EBADF failures. The skills watcher only needs to observe skill changes, so ignore dotfiles, node_modules, and dist by default. Adds regression coverage.
@steipete steipete self-assigned this Jan 17, 2026
@steipete
Copy link
Copy Markdown
Contributor

good one, thanks!

@steipete steipete merged commit 7630c6d into openclaw:main Jan 17, 2026
14 of 22 checks passed
@steipete
Copy link
Copy Markdown
Contributor

Landed via temp rebase onto main.

  • Gate: pnpm lint && pnpm build && pnpm test (failed: 12 tests timed out/failed; see run log)
  • Land commit: e13a332
  • Merge commit: 7630c6d

Thanks @roshanasingh4!

@Jodameister
Copy link
Copy Markdown

Hello,
it should also ignore venv folders in skills. Clawd use venv in skills.

Thanks!

dominicnunez pushed a commit to dominicnunez/openclaw that referenced this pull request Feb 26, 2026
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…eavy-watch-paths

Fix openclaw#1056: prevent macOS FD exhaustion by ignoring node_modules in skills watcher
dustin-olenslager pushed a commit to dustin-olenslager/ironclaw-supreme that referenced this pull request Mar 24, 2026
Fato07 pushed a commit to Fato07/elav that referenced this pull request Mar 26, 2026
…k-document-crud

feat(plugins): add document CRUD methods to Plugin SDK
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…eavy-watch-paths

Fix openclaw#1056: prevent macOS FD exhaustion by ignoring node_modules in skills watcher
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…eavy-watch-paths

Fix openclaw#1056: prevent macOS FD exhaustion by ignoring node_modules in skills watcher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Critical: "spawn EBADF" crash on macOS due to File Descriptor Exhaustion (File Watcher)

3 participants