Skip to content

fix(skills): add frontmatter-name fallback in skill_view to resolve name mismatch - #18901

Closed
shellybotmoyer wants to merge 1 commit into
NousResearch:mainfrom
shellybotmoyer:fix/skill-name-mismatch
Closed

fix(skills): add frontmatter-name fallback in skill_view to resolve name mismatch#18901
shellybotmoyer wants to merge 1 commit into
NousResearch:mainfrom
shellybotmoyer:fix/skill-name-mismatch

Conversation

@shellybotmoyer

Copy link
Copy Markdown
Contributor

Summary

Fixes the skill discovery→loading loop where skills_list reports a frontmatter name but skill_view can only resolve by directory name, making mismatched skills silently undiscoverable by the agent.

Problem

When a skill's frontmatter name differs from its directory name (e.g., directory foo but frontmatter name: bar):

  1. skills_list → returns "bar" (from frontmatter)
  2. Agent calls skill_view("bar")"Skill 'bar' not found." (resolves by directory name)
  3. Skill is unusable — no crash, no warning, just a dead entry

The agent's tool chain contradicts itself silently. The model can't self-correct because it has no way to know skill_view needs a different identifier than what skills_list reported.

Fix

Added a frontmatter-name fallback in skill_view(): when directory-name lookup fails (steps 1-3), the function now iterates all SKILL.md files and checks if the frontmatter name field matches. If found, uses that skill's directory path.

This is backwards-compatible:

  • skill_view("foo") still works (directory name lookup, existing behavior)
  • skill_view("bar") now works (frontmatter name fallback, new behavior)
  • No API changes to skills_list output

Verification

mkdir -p ~/.hermes/skills/foo
cat > ~/.hermes/skills/foo/SKILL.md << 'EOF'
---
name: bar
description: Test skill with mismatched name
---
# Bar
Content here.
EOF
  • skills_list → shows bar
  • skill_view("bar") → loads the skill (was: "not found")
  • skill_view("foo") → still loads the skill (unchanged)

Fixes #18872

…ame mismatch

When skills_list reports a frontmatter name that differs from the directory name,

skill_view now falls back to matching the frontmatter name when directory-name

lookup fails. Fixes the tool-calling loop where models discover skill bar

but can only load skill foo. Fixes NousResearch#18872.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists tool/skills Skills system (list, view, manage) labels May 2, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #18879 — same frontmatter-name fallback fix for skill_view, both fixing #18872.

@teknium1

Copy link
Copy Markdown
Contributor

This appears to be implemented on current main now.

Automated hermes-sweeper review evidence:

  • tools/skills_tool.py:1036 documents the intended behavior: skills_list() exposes the frontmatter name, so skill_view(name) must accept it even when the directory differs.
  • tools/skills_tool.py:1048 implements the fallback by parsing each SKILL.md and matching fm.get("name") == name.
  • tests/tools/test_skills_tool.py:376 adds a regression test for a directory/frontmatter mismatch and verifies skill_view("real-skill-name") loads successfully.
  • Landed on main in 9caa12f4ecd29d4376914c059306cecd405b548a (fix(skills): resolve skill_view by frontmatter name when dir name differs).

Thanks for the original fix and the discussion noting the duplicate shape here.

@teknium1 teknium1 closed this Jun 11, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists sweeper:implemented-on-main Sweeper: behavior already present on current main 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]: skill_view/skills_list name mismatch breaks agent tool-calling loop — model can't load skills it discovers

3 participants