Skip to content

fix(cli): resolve symlinked skill paths in gateway slash-command menu#39632

Open
fa1k3 wants to merge 1 commit into
NousResearch:mainfrom
fa1k3:fix/skill-menu-symlink-resolve-8108
Open

fix(cli): resolve symlinked skill paths in gateway slash-command menu#39632
fa1k3 wants to merge 1 commit into
NousResearch:mainfrom
fa1k3:fix/skill-menu-symlink-resolve-8108

Conversation

@fa1k3

@fa1k3 fa1k3 commented Jun 5, 2026

Copy link
Copy Markdown

Summary

Fixes #8108 (profile gateways register only the core command set instead of the full skill menu) for the case where a profile's skills directory is a symlink.

gateway's _collect_gateway_skill_entries (in hermes_cli/commands.py) builds its allowed-prefix set from SKILLS_DIR.resolve() (symlinks followed), but get_skill_commands() stores each skill_md_path unresolved. When the profile skills dir is a symlink to a shared source — e.g. ~/.hermes/profiles/<profile>/skills -> /some/shared/skills — the skill_path.startswith(prefix) check is False for every skill, so the entire skill tier is silently dropped from the Telegram/Discord slash-command menu. Dispatch is unaffected (resolve_skill_command_key does not do this prefix check), so /skill-name keeps working while the menu shows nothing — which is what makes it easy to misdiagnose.

Fix

Normalize skill_path with os.path.realpath before the prefix and .hub checks, so both sides are compared in the same symlink-resolved namespace. One line; the .hub exclusion and external_dirs matching are unaffected (both already resolved).

Test

Adds tests/hermes_cli/test_gateway_skill_menu_symlink.py:

  • a skill under a symlinked SKILLS_DIR now appears in the menu (the regression), and
  • a .hub skill under a symlinked SKILLS_DIR stays excluded (proves the exclusion survives normalization).

Verified red-without / green-with the fix.

Related

_collect_gateway_skill_entries builds its allowed prefixes from
SKILLS_DIR.resolve() (symlinks followed) but get_skill_commands() stores
skill_md_path unresolved. When a profile's skills dir is a symlink to a
shared source (e.g. ~/.hermes/profiles/<p>/skills -> external), the
startswith() prefix check fails for every skill and the entire skill tier
is silently dropped from the Telegram/Discord slash-command menu, while
/skill-name dispatch still works.

Normalize skill_path with os.path.realpath so both sides are compared in
the same symlink-resolved namespace. Adds a regression test.

Fixes NousResearch#8108. Extends NousResearch#8110 (external_dirs prefix widening). Complements
NousResearch#27662 (symlinked dispatch loading).
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard tool/skills Skills system (list, view, manage) labels Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have 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.

Bug: profile Telegram gateways register only core command set instead of full skill menu

2 participants