Repository navigation
fix(skills): resolve skills.create_dir in skill_view, skills_list and slash commands - #108160
Closed
neo-wanderer wants to merge 1 commit into
Closed
neo-wanderer wants to merge 1 commit into
neo-wanderer wants to merge 1 commit into
Conversation
… slash commands The system-prompt skill index is built from get_all_skills_dirs(), which folds skills.create_dir in after the local dir. The read paths that then resolve an advertised name each hand-assembled their own list as local + get_external_skills_dirs() and never saw create_dir. A skill the agent created there (or an operator placed there) was listed in the prompt, but skill_view returned "not found", skills_list omitted it, and no /slash command or gateway menu entry was registered for it. Switch those call sites to get_all_skills_dirs()[1:] - the form prompt_builder and skill_usage already use - so every discovery surface scans the same dirs the index advertises: - tools/skills_tool.py: _skill_search_dirs (skill_view, skills_list) and _get_category_from_path - agent/skill_commands.py: scan_skill_commands - hermes_cli/commands_platforms.py: _iter_gateway_skills get_all_skills_dirs() already dedups create_dir against external_dirs and _collect_skill_candidates dedups by resolved path, so listing one directory under both keys stays unambiguous (covered by a test). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015jsCfn6VnuphwzZTrqcfwM
1 task done
Author
|
Closing — this is fixed on
Verified with the repro from #108157 (plus a hand-placed |
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 in
skills.create_dir(#100377) show up in the system-prompt skill index, becausebuild_skills_system_promptusesget_all_skills_dirs()[1:]. Butskill_viewreturns "not found" for them,skills_listleaves them out, and they get no/slashcommand or Telegram/Discord menu entry. Those read paths each build their directory list by hand as local +get_external_skills_dirs(), which skipscreate_dir.This PR moves those call sites to
get_all_skills_dirs()[1:], the formprompt_builderandskill_usagealready use. Every discovery surface then scans the same directories the index advertises.get_all_skills_dirs()already removes duplicates betweencreate_dirandexternal_dirs, and_collect_skill_candidatesremoves duplicates by resolved path. So a directory listed under both keys stays unambiguous, and a regression test covers that.Related Issue
Fixes #108157
Type of Change
Changes Made
tools/skills_tool.py:_skill_search_dirs(backsskill_view+skills_list) and_get_category_from_path(socreate_dirskills get their category inskills_list)agent/skill_commands.py:scan_skill_commands, so/skill-nameregisters forcreate_dirskills; the precedence comment now reads project > local > create_dir > externalhermes_cli/commands_platforms.py:_iter_gateway_skillsroots (Telegram menu, Discord/skillgroups, inline picker)tests/tools/test_skill_create_dir.py: newTestReadPathDiscoveryclass with 6 tests:skill_view,skill_managecreate →skill_viewend to end,skills_listwith category,create_diralso listed inexternal_dirs(no ambiguity), slash-command registration, and the gateway menuDeliberately not touched:
hermes_cli/commands.py's legacy_collect_gateway_skill_entries/discord_skill_commands. They have the same pattern, but no live caller uses them (the compat map redirects tocommands_platforms), and they are due for removal on 2026-09-14.tools/credential_files.py::_skill_dir_roots(remote-sandbox skill sync). It also skipscreate_dir, but it uses a different mount layout, so it is flagged in skills.create_dir skills are advertised in the prompt but skill_view / skills_list / slash commands can't find them #108157 as a follow-up.This PR shares no files with the open #108040.
How to Test
origin/mainwith the new tests only:scripts/run_tests.sh tests/tools/test_skill_create_dir.py -q -k TestReadPathDiscoverygives 5 failed, 1 passed. The one that passes is the dedup guard, which holds both before and after the fix. Each failure is the reported symptom, e.g.{'success': False, 'error': "Skill 'brain-skill' not found.", ...}.scripts/run_tests.sh tests/tools/test_skill_create_dir.py -qgives 22 passed.test_skill_create_dir,test_skill_commands,test_commands,test_discord_skill_clamp_warning,test_skills_tool,test_skill_utils,test_external_skills,test_project_skills,test_prompt_builder,test_skill_manager_tool,test_skill_usageandtest_web_server_skills_profiles. The gateway consumers also pass: 53 passed acrosstest_telegram_inline_picker,test_discord_slash_commands,test_reload_skills_discord_resync,test_telegram_forum_commandsandtest_discord_slash_auth.HERMES_HOME:scripts/run_tests.sh, Linux, Python 3.12,.[dev]extras only): 4033 files, 48,349 passed, 151 failed, 441 skipped. None of the failures come from this PR. I re-ran every failing file on unpatchedorigin/mainand compared test IDs, and no test fails on this branch that doesn't also fail onmain.mainfails 169 IDs to this branch's 167. The two extra ones are a flaky subagent-handoff test and an FTS5 test in a file that timed out here under full parallel load. The failures come from missing optional extras (ACP, platform SDKs), provider/credential tests, gateway adapters and wisdom setup; none of them touch skills. Two files did not run in the full pass because of per-file timeouts,tests/test_hermes_state.pyandtests/wisdom/test_installed_setup.py. Run on their own, both give identical results on this branch and onmain.Checklist
Code
fix(scope):,feat(scope):, etc.)origin/main(see How to Test §5)Documentation & Housekeeping
docs/, docstrings) — docstrings/comments onlycli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/Aget_all_skills_dirs()values already used by the prompt builder)🤖 Generated with Claude Code
https://claude.ai/code/session_015jsCfn6VnuphwzZTrqcfwM