Skip to content

fix: use Path.parts for hidden directory filter in skill listing - #390

Merged
teknium1 merged 1 commit into
NousResearch:mainfrom
Farukest:fix/hidden-dir-filter-windows
Mar 5, 2026
Merged

fix: use Path.parts for hidden directory filter in skill listing#390
teknium1 merged 1 commit into
NousResearch:mainfrom
Farukest:fix/hidden-dir-filter-windows

Conversation

@Farukest

@Farukest Farukest commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

The hidden directory filter in _find_all_skills() and scan_skill_commands() used hardcoded forward-slash strings like '/.git/' and '/.hub/'. On Windows, str(Path(...)) returns backslash paths, so the filter never matched. Quarantined skills in .hub/quarantine/ appeared as installed skills and available slash commands.

Replaced string-based checks with Path.parts membership test which works on both Windows and Unix.

Tests

Added tests/tools/test_hidden_dir_filter.py with 11 tests:

Old filter regression (3 tests):

  • Old filter misses .hub in Windows-style path string
  • Old filter misses .git in Windows-style path string
  • Old filter works on Unix paths (confirming it's Windows-specific)

New filter cross-platform (6 tests):

  • .hub/quarantine/ correctly filtered
  • .git/ correctly filtered
  • .github/ correctly filtered
  • Normal skill not filtered
  • Nested skill not filtered
  • Dot-prefix skill not in filter list passes (no false positives)

Path.parts behavior (2 tests):

  • .hub appears in parts of path containing .hub/ directory
  • .hub does not match substring in directory name like my-hub-skill

Closes #389

The hidden directory filter used hardcoded forward-slash strings like
'/.git/' and '/.hub/' to exclude internal directories. On Windows,
Path returns backslash-separated strings, so the filter never matched.

This caused quarantined skills in .hub/quarantine/ to appear as
installed skills and available slash commands on Windows.

Replaced string-based checks with Path.parts membership test which
works on both Windows and Unix.
@teknium1
teknium1 merged commit 7128f95 into NousResearch:main Mar 5, 2026
Himess added a commit to Himess/hermes-agent that referenced this pull request Mar 6, 2026
…er paths

The ripgrep/grep output parser uses `split(':', 2)` to extract
file:lineno:content from match lines. On Windows, absolute paths
contain a drive letter colon (e.g. `C:\Users\foo\bar.py:42:content`),
so `split(':', 2)` produces `["C", "\Users\...", "42:content"]`.
`int(parts[1])` then raises ValueError and the match is silently
dropped. All search results are lost on Windows.

Same category as NousResearch#390 — string-based path parsing that fails on
Windows. Replace `split()` with a regex that optionally captures
the drive letter prefix: `^([A-Za-z]:)?(.*?):(\d+):(.*)$`.

Applied to both `_search_with_rg` and `_search_with_grep`.
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
Authored by Farukest. Fixes NousResearch#389.

Replaces hardcoded forward-slash string checks ('/.git/', '/.hub/') with
Path.parts membership test in _find_all_skills() and scan_skill_commands().
On Windows, str(Path) uses backslashes so the old filter never matched,
causing quarantined skills to appear as installed.
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…er paths

The ripgrep/grep output parser uses `split(':', 2)` to extract
file:lineno:content from match lines. On Windows, absolute paths
contain a drive letter colon (e.g. `C:\Users\foo\bar.py:42:content`),
so `split(':', 2)` produces `["C", "\Users\...", "42:content"]`.
`int(parts[1])` then raises ValueError and the match is silently
dropped. All search results are lost on Windows.

Same category as NousResearch#390 — string-based path parsing that fails on
Windows. Replace `split()` with a regex that optionally captures
the drive letter prefix: `^([A-Za-z]:)?(.*?):(\d+):(.*)$`.

Applied to both `_search_with_rg` and `_search_with_grep`.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…er paths

The ripgrep/grep output parser uses `split(':', 2)` to extract
file:lineno:content from match lines. On Windows, absolute paths
contain a drive letter colon (e.g. `C:\Users\foo\bar.py:42:content`),
so `split(':', 2)` produces `["C", "\Users\...", "42:content"]`.
`int(parts[1])` then raises ValueError and the match is silently
dropped. All search results are lost on Windows.

Same category as NousResearch#390 — string-based path parsing that fails on
Windows. Replace `split()` with a regex that optionally captures
the drive letter prefix: `^([A-Za-z]:)?(.*?):(\d+):(.*)$`.

Applied to both `_search_with_rg` and `_search_with_grep`.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
Authored by Farukest. Fixes NousResearch#389.

Replaces hardcoded forward-slash string checks ('/.git/', '/.hub/') with
Path.parts membership test in _find_all_skills() and scan_skill_commands().
On Windows, str(Path) uses backslashes so the old filter never matched,
causing quarantined skills to appear as installed.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…er paths

The ripgrep/grep output parser uses `split(':', 2)` to extract
file:lineno:content from match lines. On Windows, absolute paths
contain a drive letter colon (e.g. `C:\Users\foo\bar.py:42:content`),
so `split(':', 2)` produces `["C", "\Users\...", "42:content"]`.
`int(parts[1])` then raises ValueError and the match is silently
dropped. All search results are lost on Windows.

Same category as NousResearch#390 — string-based path parsing that fails on
Windows. Replace `split()` with a regex that optionally captures
the drive letter prefix: `^([A-Za-z]:)?(.*?):(\d+):(.*)$`.

Applied to both `_search_with_rg` and `_search_with_grep`.
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.

Hidden directory filter in skill listing uses hardcoded /, broken on Windows

2 participants