← Back to PRs

#6777: fix(skills): ignore Python venvs and caches in skills watcher

by kirkluokun open 2026-02-02 01:52 View on GitHub →
agents
## Summary - Add Python virtual environment directories (`.venv`, `venv`, `.envs`, `ENV`) to `DEFAULT_SKILLS_WATCH_IGNORED` - Add Python cache directories (`__pycache__`, `.pytest_cache`, `.mypy_cache`, `.ruff_cache`) - Add build output directories (`build`, `coverage`) - Add temp directories (`.cache`, `.tmp`) ## Problem The skills watcher currently only ignores `.git`, `node_modules`, and `dist`. When a skill directory contains a Python virtual environment (`.venv`), and the workspace is migrated to a new location, the stale `.venv` paths cause Node.js `child_process.spawn` to fail with `EBADF` error on macOS. This is a known issue affecting multiple Node.js projects on macOS: - [Bug]: Exec tool fails with spawn EBADF on macOS #5341 - Similar issues in Claude Code, Nuxt/Vite, and other projects ## Root Cause When chokidar watches a directory containing `.venv`: 1. The `.venv` directory contains symlinks and binary files 2. After workspace migration, these paths become stale 3. Watching these directories triggers file descriptor issues 4. This causes `spawn EBADF` errors in any child process spawn ## Solution Expand `DEFAULT_SKILLS_WATCH_IGNORED` to exclude: - Python virtual environments - Python tool caches - Build outputs - Temp directories These directories should not trigger skill reload anyway, as they don't contain `SKILL.md` files. ## Test Plan - [x] Updated `refresh.test.ts` to verify new ignored patterns - [x] Verified regex patterns match expected paths <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR expands the default chokidar ignore list used by the skills watcher (`ensureSkillsWatcher`) to exclude common non-skill directories (Python virtualenvs and caches, build outputs, temp/cache dirs) to avoid noisy reloads and reduce macOS file descriptor issues when watching large trees. A corresponding unit test was updated to assert that these new patterns are included and that normal skill files (e.g. `SKILL.md`) are not ignored. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk. - Changes are limited to broadening a watcher ignore list and updating a unit test; the added regexes are standard path-segment matches and the change does not affect core logic beyond excluding more directories from watch events. - No files require special attention <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs