Skip to content

Fix hidden directory filter broken on Windows - #401

Closed
ch3ronsa wants to merge 1 commit into
NousResearch:mainfrom
ch3ronsa:fix/windows-hidden-dir-filter
Closed

Fix hidden directory filter broken on Windows#401
ch3ronsa wants to merge 1 commit into
NousResearch:mainfrom
ch3ronsa:fix/windows-hidden-dir-filter

Conversation

@ch3ronsa

@ch3ronsa ch3ronsa commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #389

Summary

  • _find_all_skills() in tools/skills_tool.py and scan_skill_commands() in agent/skill_commands.py used hardcoded forward-slash strings ('/.git/', '/.hub/') to filter hidden directories
  • On Windows, str(Path(...)) returns backslash-separated paths, so the filter never matched
  • This exposed quarantined skills (downloaded but not yet approved by security scanner) as installed and invocable on Windows

Fix

Replaced string-based path check with Path.parts membership test, which is platform-independent:

# Before (broken on Windows):
if '/.git/' in path_str or '/.github/' in path_str or '/.hub/' in path_str:

# After (works on all platforms):
if any(part in ('.git', '.github', '.hub') for part in skill_md.parts):

Test plan

  • Verified with simulated Windows paths (C:\Users\me\.hermes\skills\.hub\quarantine\...) — correctly blocked
  • Verified with simulated Linux paths (/home/me/.hermes/skills/.hub/...) — correctly blocked
  • Legitimate skills not affected on either platform

Both _find_all_skills() and scan_skill_commands() used hardcoded
forward-slash strings ('/.git/', '/.hub/') to filter hidden dirs.
On Windows, str(Path(...)) returns backslash paths so the filter
never matched, exposing quarantined skills to users.

Replace string-based check with Path.parts membership test which
works on all platforms.
@ch3ronsa

ch3ronsa commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

Didn't notice #390 already covers this with the same Path.parts fix and a full test suite. Closing as duplicate.

@ch3ronsa ch3ronsa closed this Mar 4, 2026
zebadee2kk added a commit to zebadee2kk/hermes-agent that referenced this pull request Jun 20, 2026
cermm added a commit to cermm/hermes-agent that referenced this pull request Aug 1, 2026
NousResearch#401)

Exact owned-fork merge authorized by umbrella-auth-1533030101162266695 after semantic, security and immutable PASS plus 49 authoritative CI checks (44 success, 5 policy skips), exact head/base and clean mergeability readback. No NousResearch upstream mutation.
cermm added a commit to cermm/hermes-agent that referenced this pull request Aug 17, 2026
cermm added a commit to cermm/hermes-agent that referenced this pull request Aug 17, 2026
cermm added a commit to cermm/hermes-agent that referenced this pull request Aug 17, 2026
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

1 participant