#9595: fix(skills): ignore .venv, __pycache__, and .openclaw to prevent FD exhaustion (#9481)
agents
stale
Cluster:
Skill Enhancements and Fixes
Fixes #9481. Adds common Python virtual environment and cache directories, along with the internal .openclaw directory, to the skills watcher ignore list. This prevents file descriptor (FD) exhaustion and 'spawn EBADF' errors when these directories contain thousands of files.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the skills watcher’s ignore list to skip common high-churn Python directories (`.venv`, `__pycache__`) and OpenClaw’s internal `.openclaw` directory. The goal is to prevent file descriptor exhaustion (e.g., `spawn EBADF`) when these directories contain very large file trees, reducing watcher load during skill refresh operations.
<h3>Confidence Score: 3/5</h3>
- This PR is close, but it introduces a watcher ignore pattern that likely disables watching globally-installed skills under `~/.openclaw/skills`.
- Change is small and targeted, but the `.openclaw` ignore regex appears to match the same config directory subtree that `resolveWatchPaths()` adds to the watch set, which would silently break refresh behavior for global skills.
- src/agents/skills/refresh.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#8291: Fix: Add Python virtual environment ignore patterns to skills watcher
by vishaltandale00 · 2026-02-03
89.1%
#14023: fix: filter skills watcher to relevant file types to prevent FD exh...
by funmerlin · 2026-02-11
85.9%
#6777: fix(skills): ignore Python venvs and caches in skills watcher
by kirkluokun · 2026-02-02
85.2%
#10016: fix: prevent FD exhaustion from skill watcher scanning artifact trees
by oldeucryptoboi · 2026-02-06
83.5%
#8873: fix: document skill loading locations in system prompt
by ytfh44 · 2026-02-04
82.5%
#9925: docs: warn about Python venv placement in skill directories
by kj9kj9qv4m-bit · 2026-02-05
82.0%
#11250: fix: expand skills watcher ignore list and improve session repair l...
by zhangzhefang-github · 2026-02-07
81.0%
#12076: fix(skills): recursive directory filtering to actually exclude venv...
by xiaoyaner0201 · 2026-02-08
78.8%
#3933: fix(skills): Make skill scripts executable
by jaysonsantos · 2026-01-29
78.5%
#16654: fix: refresh skills snapshot when managed skills change
by PhineasFleabottom · 2026-02-15
75.1%