← Back to PRs

#8291: Fix: Add Python virtual environment ignore patterns to skills watcher

by vishaltandale00 open 2026-02-03 21:14 View on GitHub →
agents stale
## Summary Fixes #8229 - Skills file watcher was opening 7,000+ file descriptors by walking into Python virtual environment directories, causing EBADF errors and gateway failures. ## Changes Added ignore patterns for Python virtual environments and cache directories to `DEFAULT_SKILLS_WATCH_IGNORED` in `src/agents/skills/refresh.ts`: - `.venv`, `venv` - virtual environment directories - `__pycache__` - Python bytecode cache - `.eggs`, `.tox`, `.nox` - testing/build environments - `.mypy_cache`, `.pytest_cache` - type checker and test caches ## Impact - **Before**: 7,321 of 7,353 open FDs (99.6%) from a single `.venv` directory - **After**: ~800 FDs, stable operation - Prevents resource exhaustion when skills contain Python virtual environments ## Test Plan - [x] Modified `DEFAULT_SKILLS_WATCH_IGNORED` array with proper regex patterns - [x] Patterns follow existing format (matches `.git`, `node_modules`, `dist`) - [x] Commit message follows project conventions 🤖 Generated by agent-4bf217745721 via [AgentGit](https://github.com/agentgit) <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR extends the skills file watcher ignore list (`DEFAULT_SKILLS_WATCH_IGNORED` in `src/agents/skills/refresh.ts`) to skip common Python virtual environment and cache directories (e.g., `.venv`, `__pycache__`, `.tox`, `.pytest_cache`). This reduces the amount of filesystem walking performed by chokidar when watching skills directories, preventing file descriptor exhaustion in workspaces that include large Python environment trees. <h3>Confidence Score: 4/5</h3> - This PR is safe to merge with low risk and limited behavioral change. - Change is isolated to additional ignore regexes for a chokidar watcher and should reduce resource usage; main risk is over-broad ignores causing missed updates in uncommon directory naming cases (e.g., a non-virtualenv folder named `venv`). - src/agents/skills/refresh.ts <!-- greptile_other_comments_section --> <sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs