fix(skills): support editing symlinked Skills - #83808
Conversation
Skill 列表使用会跟随符号链接的统一遍历器,而编辑查找仍使用不跟随目录符号链接的 Path.rglob,导致 CC Switch 导入的 Skill 无法编辑。统一编辑查找逻辑并增加回归测试。
monerostar
left a comment
There was a problem hiding this comment.
Ubuntu 26.04 on linux-5800x (kernel 7.0.0-28-generic, Python 3.11.15). Directory symlinks work here.
Live matrix for editing a skill whose skills/ entry is a directory symlink:
- origin/main + the new test only: TestFindSkill::test_edit_follows_directory_symlink -> FAILED (result["success"] is False)
- PR tip e247177: same test -> 1 passed
- Full tests/tools/test_skill_manager_tool.py on PR -> 48 passed
Root cause matches the diff: main _find_skill still uses skills_dir.rglob("SKILL.md"), which skips symlink dirs. PR switches to iter_skill_index_files (already on main) so the target SKILL.md is found and updated.
Looks good. Useful Linux fix, small scope.
fix(skills): support editing symlinked Skills — the cc-switch use case (shared skills living behind a directory symlink) is legitimate and the change to
|
Summary
Root cause
CC Switch imports Skills into Hermes through directory symlinks. Skill listing and viewing already use
iter_skill_index_files(), which follows those links, while the editor usedPath.rglob("SKILL.md"), which did not. The Skill appeared in the UI but the editor returnedSkill not found.Test plan
uv run --extra dev pytest -q tests/tools/test_skill_manager_tool.py tests/tools/test_skills_tool.py tests/tools/test_skills_tool_discovery_cache.py tests/tools/test_skills_tool_profile_scope.py tests/hermes_cli/test_web_server_skill_editor.pyscripts/run_tests.sh tests/tools/test_skill_manager_tool.py -quv run --extra dev ruff check tools/skill_manager_tool.py tests/tools/test_skill_manager_tool.pyAll Skill-related tests passed locally. This PR is intentionally limited to the Skill lookup fix and its regression test; the browser CLI PATH fix is kept in a separate PR.