fix(gateway): include external_dirs skills in Telegram/Discord slash command registration#8790
Closed
luyao618 wants to merge 1 commit into
Closed
Conversation
d23bee2 to
a2e86ec
Compare
a2e86ec to
c2d35c2
Compare
…command registration Skills configured via skills.external_dirs in config.yaml were visible in CLI and agent but silently excluded from Telegram/Discord slash command menus. The path filter in _collect_gateway_skill_entries() only accepted skills under SKILLS_DIR (~/.hermes/skills/), dropping any skill whose path did not start with that prefix. Widen the allowed-prefix set to include all configured external directories. Also enforce trailing "/" on every prefix to prevent false-positive matches when one directory name is a prefix of another (e.g. /my-skills vs /my-skills-extra), and skip entries with empty skill_md_path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c2d35c2 to
2defc1c
Compare
Contributor
|
Salvaged as #18741 with you as co-author — the fix was correct and applied cleanly. Thanks for the path-prefix boundary handling and the 7-test coverage. |
teknium1
added a commit
that referenced
this pull request
May 2, 2026
…commands (#18741) Skills configured through `skills.external_dirs` in config.yaml were visible via `hermes skills list`, `get_skill_commands()`, and the agent's `/skill-name` dispatch, but silently excluded from the Telegram and Discord slash-command menus. The filter in `_collect_gateway_skill_entries` only accepted skills whose `skill_md_path` started with `SKILLS_DIR`, so anything under an external directory fell through. Widen the accepted-prefix set to include all configured external dirs alongside the local skills dir. Every prefix is now slash-terminated so `/my-skills` cannot also admit `/my-skills-extra`. Also guard against empty `skill_md_path` values so they can't accidentally match. Fixes #8110 Salvages #8790 by luyao618. Co-authored-by: Yao <34041715+luyao618@users.noreply.github.com>
nickdlkk
pushed a commit
to nickdlkk/hermes-agent
that referenced
this pull request
May 11, 2026
…commands (NousResearch#18741) Skills configured through `skills.external_dirs` in config.yaml were visible via `hermes skills list`, `get_skill_commands()`, and the agent's `/skill-name` dispatch, but silently excluded from the Telegram and Discord slash-command menus. The filter in `_collect_gateway_skill_entries` only accepted skills whose `skill_md_path` started with `SKILLS_DIR`, so anything under an external directory fell through. Widen the accepted-prefix set to include all configured external dirs alongside the local skills dir. Every prefix is now slash-terminated so `/my-skills` cannot also admit `/my-skills-extra`. Also guard against empty `skill_md_path` values so they can't accidentally match. Fixes NousResearch#8110 Salvages NousResearch#8790 by luyao618. Co-authored-by: Yao <34041715+luyao618@users.noreply.github.com>
jsboige
pushed a commit
to jsboige/hermes-agent
that referenced
this pull request
May 14, 2026
…commands (NousResearch#18741) Skills configured through `skills.external_dirs` in config.yaml were visible via `hermes skills list`, `get_skill_commands()`, and the agent's `/skill-name` dispatch, but silently excluded from the Telegram and Discord slash-command menus. The filter in `_collect_gateway_skill_entries` only accepted skills whose `skill_md_path` started with `SKILLS_DIR`, so anything under an external directory fell through. Widen the accepted-prefix set to include all configured external dirs alongside the local skills dir. Every prefix is now slash-terminated so `/my-skills` cannot also admit `/my-skills-extra`. Also guard against empty `skill_md_path` values so they can't accidentally match. Fixes NousResearch#8110 Salvages NousResearch#8790 by luyao618. Co-authored-by: Yao <34041715+luyao618@users.noreply.github.com>
dannyJ848
pushed a commit
to dannyJ848/hermes-agent
that referenced
this pull request
May 17, 2026
…commands (NousResearch#18741) Skills configured through `skills.external_dirs` in config.yaml were visible via `hermes skills list`, `get_skill_commands()`, and the agent's `/skill-name` dispatch, but silently excluded from the Telegram and Discord slash-command menus. The filter in `_collect_gateway_skill_entries` only accepted skills whose `skill_md_path` started with `SKILLS_DIR`, so anything under an external directory fell through. Widen the accepted-prefix set to include all configured external dirs alongside the local skills dir. Every prefix is now slash-terminated so `/my-skills` cannot also admit `/my-skills-extra`. Also guard against empty `skill_md_path` values so they can't accidentally match. Fixes NousResearch#8110 Salvages NousResearch#8790 by luyao618. Co-authored-by: Yao <34041715+luyao618@users.noreply.github.com>
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…commands (NousResearch#18741) Skills configured through `skills.external_dirs` in config.yaml were visible via `hermes skills list`, `get_skill_commands()`, and the agent's `/skill-name` dispatch, but silently excluded from the Telegram and Discord slash-command menus. The filter in `_collect_gateway_skill_entries` only accepted skills whose `skill_md_path` started with `SKILLS_DIR`, so anything under an external directory fell through. Widen the accepted-prefix set to include all configured external dirs alongside the local skills dir. Every prefix is now slash-terminated so `/my-skills` cannot also admit `/my-skills-extra`. Also guard against empty `skill_md_path` values so they can't accidentally match. Fixes NousResearch#8110 Salvages NousResearch#8790 by luyao618. Co-authored-by: Yao <34041715+luyao618@users.noreply.github.com>
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
…commands (NousResearch#18741) Skills configured through `skills.external_dirs` in config.yaml were visible via `hermes skills list`, `get_skill_commands()`, and the agent's `/skill-name` dispatch, but silently excluded from the Telegram and Discord slash-command menus. The filter in `_collect_gateway_skill_entries` only accepted skills whose `skill_md_path` started with `SKILLS_DIR`, so anything under an external directory fell through. Widen the accepted-prefix set to include all configured external dirs alongside the local skills dir. Every prefix is now slash-terminated so `/my-skills` cannot also admit `/my-skills-extra`. Also guard against empty `skill_md_path` values so they can't accidentally match. Fixes NousResearch#8110 Salvages NousResearch#8790 by luyao618. Co-authored-by: Yao <34041715+luyao618@users.noreply.github.com>
Seven74AI
pushed a commit
to Seven74AI/hermes-agent
that referenced
this pull request
Jun 13, 2026
…commands (NousResearch#18741) Skills configured through `skills.external_dirs` in config.yaml were visible via `hermes skills list`, `get_skill_commands()`, and the agent's `/skill-name` dispatch, but silently excluded from the Telegram and Discord slash-command menus. The filter in `_collect_gateway_skill_entries` only accepted skills whose `skill_md_path` started with `SKILLS_DIR`, so anything under an external directory fell through. Widen the accepted-prefix set to include all configured external dirs alongside the local skills dir. Every prefix is now slash-terminated so `/my-skills` cannot also admit `/my-skills-extra`. Also guard against empty `skill_md_path` values so they can't accidentally match. Fixes NousResearch#8110 Salvages NousResearch#8790 by luyao618. Co-authored-by: Yao <34041715+luyao618@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Skills configured via
skills.external_dirsinconfig.yamlwere visible in CLI (hermes skills list) and usable by the agent, but silently excluded from Telegram and Discord slash command menus. Users who organized skills in external directories could not invoke them via/slash-commandson gateway platforms.The root cause is in
_collect_gateway_skill_entries()(hermes_cli/commands.py): it filtered skills by checkingskill_path.startswith(_skills_dir)where_skills_diris only~/.hermes/skills/. External skills have paths outside this prefix (e.g.~/my-skills/morning-briefing/SKILL.md), so they were dropped by thecontinuestatement. Meanwhile,scan_skill_commands()correctly scans both local and external directories — the inconsistency was only in the gateway registration path.This PR widens the allowed-prefix set to include all configured external directories alongside the local skills dir. It also:
/on all directory prefixes to prevent false-positive matches when one directory name is a prefix of another (e.g./my-skillsvs/my-skills-extra)skill_md_pathto avoid accidental matchesRelated Issue
Fixes #8110
Type of Change
Changes Made
hermes_cli/commands.py: Importget_external_skills_dirs, build_allowed_prefixesfromSKILLS_DIR+ external dirs (all slash-terminated), replace singlestartswith(_skills_dir)withany(startswith(prefix) for prefix in _allowed_prefixes), add empty-path guard, slash-terminate_hub_dirfor consistencytests/hermes_cli/test_gateway_external_skills.py(new): 7 test cases covering external skill inclusion, local-only behavior, hub exclusion, path-prefix boundary safety, multiple external dirs, empty skill_md_path handling, and hub-sibling directory boundaryHow to Test
pytest tests/hermes_cli/test_gateway_external_skills.py -v— all 7 tests passpytest tests/ -q— full suite passes (pre-existing env-dependent failures are unrelated)skills.external_dirsin~/.hermes/config.yamlpointing to a directory with a validSKILL.mdhermes skills listshows the external skillgetMyCommands)Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A