Skip to content

fix(skills): resolve skill_view by frontmatter name when dir name differs - #43323

Merged
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:fix/skill-view-frontmatter-name-lookup
Jun 10, 2026
Merged

fix(skills): resolve skill_view by frontmatter name when dir name differs#43323
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:fix/skill-view-frontmatter-name-lookup

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Summary

Allow skill_view to resolve a skill by its frontmatter name: when the on-disk directory name differs.

skills_list() surfaces each skill's frontmatter name:, but skill_view() previously only matched on the on-disk directory name (Strategy 2). When a skill's directory is a shorter category/alias that differs from its frontmatter name, skill_view(name) failed to find it. The recursive Strategy-2 walk now also matches frontmatter name:, guarded by a try/except so an unreadable/malformed SKILL.md can't break discovery.

Context

This is a single-concern salvage of one part of #39682, lifted onto current main. The original PR shipped this change without a test; this PR adds one. The other concerns in #39682 are already resolved upstream (Desktop dist/** and nested-category plugin discovery both landed on main separately), and the Langfuse data-URI fix from that PR is sent as its own PR.

Test Plan

venv/bin/python -m pytest tests/tools/test_skills_tool.py -q
  • 87 passed (adds test_view_skill_by_frontmatter_name_when_dir_differs).
  • RED-GREEN verified: the new test fails on current main (skill not found) and passes with this change, proving it exercises the new frontmatter-name lookup path.
  • ruff check clean on touched files.

Co-authored-by: foras910521-lab foras910521-lab@users.noreply.github.com

…fers

skills_list() surfaces each skill's frontmatter `name:`, but skill_view()
only matched on the on-disk directory name (Strategy 2). When a skill's
directory is a shorter category/alias that differs from its frontmatter
name, skill_view(name) failed to find it. Extend the recursive Strategy-2
walk to also match frontmatter `name:`, guarded by a try/except so an
unreadable/malformed SKILL.md can't break discovery.

Adds a regression test that creates a skill whose directory name differs
from its frontmatter name and asserts skill_view resolves it (fails on
current main, passes with this change).

Salvaged the skill_view fix from NousResearch#39682 onto current main as a standalone,
single-concern change with the test the original PR lacked.

Co-authored-by: foras910521-lab <foras910521-lab@users.noreply.github.com>
@alt-glitch alt-glitch added type/bug Something isn't working tool/skills Skills system (list, view, manage) P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jun 10, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #30906 — same skill_view frontmatter-name fallback fix in tools/skills_tool.py. This is part of a saturated cluster: #17918 and #18879 (closed), #18901 and #28305 (still open), all targeting root issue #17914. The canonical open PR is #30906; this one adds a test (which #30906 lacks), so the test may be worth salvaging into the canonical PR. Consolidation needed across the chain.

@kshitijk4poor
kshitijk4poor merged commit 0092015 into NousResearch:main Jun 10, 2026
23 checks passed
alt-glitch pushed a commit that referenced this pull request Jun 14, 2026
…er-name-lookup

fix(skills): resolve skill_view by frontmatter name when dir name differs
T02200059 pushed a commit to T02200059/hermes-agent that referenced this pull request Jun 18, 2026
…ew-frontmatter-name-lookup

fix(skills): resolve skill_view by frontmatter name when dir name differs
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…ew-frontmatter-name-lookup

fix(skills): resolve skill_view by frontmatter name when dir name differs
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
…ew-frontmatter-name-lookup

fix(skills): resolve skill_view by frontmatter name when dir name differs
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…ew-frontmatter-name-lookup

fix(skills): resolve skill_view by frontmatter name when dir name differs
@kshitijk4poor
kshitijk4poor deleted the fix/skill-view-frontmatter-name-lookup branch August 5, 2026 07:08
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
…ew-frontmatter-name-lookup

fix(skills): resolve skill_view by frontmatter name when dir name differs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists 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.

2 participants