Skip to content

fix: follow symlinks when scanning for SKILL.md#9253

Closed
rexliu1912-star wants to merge 1 commit into
NousResearch:mainfrom
rexliu1912-star:fix/symlink-rglob-skills
Closed

fix: follow symlinks when scanning for SKILL.md#9253
rexliu1912-star wants to merge 1 commit into
NousResearch:mainfrom
rexliu1912-star:fix/symlink-rglob-skills

Conversation

@rexliu1912-star

Copy link
Copy Markdown

Problem

Python 3.11 Path.rglob() does not follow symlinks into directories. When skill directories are symlinked (e.g., ~/.hermes/skills/clawd-imports/rex-ink → ~/clawd/skills/rex-ink), they are completely invisible to the skill scanner.

In my setup, 11 symlinked skills from ~/clawd/skills/ were not registered — only real directories were found.

Fix

Add a _rglob_skills() helper that uses os.walk(followlinks=True) instead of rglob("SKILL.md"). Replace the 3 existing rglob calls:

  • _find_all_skills() (line ~535) — main skill discovery
  • skills_categories() (line ~665) — category listing
  • skill_view() (line ~824) — skill lookup by name

Testing

  • Before fix: 99 skills registered (11 symlinked missing)
  • After fix: 133 skills registered (all symlinked skills discovered)
  • Verified with skill_view("rex-ink") returning full content
  • Gateway restarted, all skills loaded correctly

Scope

Minimal change — one new helper function, three call-site substitutions. No behavior change for non-symlinked setups.

Python 3.11's Path.rglob() does not follow symlinks into directories.
This causes symlinked skill directories to be invisible to the scanner.

Add _rglob_skills() helper using os.walk(followlinks=True) to replace
three rglob('SKILL.md') calls in _find_all_skills(), skills_categories(),
and skill_view().

Fixes: 11 symlinked skills from ~/clawd/skills/ were not registered.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) labels Apr 27, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #12624 — same fix (os.walk followlinks=True for SKILL.md discovery). #14740 already merged a partial fix for symlinked category dirs.

jankadlecek added a commit to jankadlecek/hermes-agent that referenced this pull request May 24, 2026
OpenAI's "Enable device code authorization for Codex" toggle in ChatGPT
Settings is broken/missing for many account types since early 2026
(openai/codex NousResearch#9253, NousResearch#9282, NousResearch#9327, NousResearch#9418). Hermes dashboard's KEYS →
Codex LOGIN button uses device code internally, so it fails out of the
box. Local `codex login` uses PKCE with a localhost callback and is
unaffected, so let the operator do that login on their Mac and ship
the resulting tokens to the container via a base64 env var.

The bootstrap runs once when CODEX_AUTH_JSON_B64 is set AND the Hermes
auth store does not yet exist on the volume. It writes both the Codex
CLI shared file and the Hermes auth.json with active_provider set to
"openai-codex", so Hermes's auto-detect picks Codex without needing
any further dashboard interaction.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the careful investigation and the clean patch, @rexliu1912-star! This fix was independently merged just a few days after your PR was opened.

This is an automated hermes-sweeper review.

The fix is already on main:

  • Commit 02aba4a7 (fix(skills): follow symlinks in iter_skill_index_files, 2026-04-18) added followlinks=True to os.walk() inside the central iter_skill_index_files() helper in agent/skill_utils.py (line 446).
  • All SKILL.md discovery call sites in tools/skills_tool.py (lines 575 and 971) route through that helper, so symlinked skill directories are now fully visible to the scanner.
  • Shipped in v2026.4.23 and later.

The @alt-glitch reference to #12624 and #14740 is consistent with this — the fix landed via that path before this PR could be merged. Closing as implemented on main.

@teknium1 teknium1 closed this Jun 10, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants