fix(skills): strip duplicate description prefix + fix 15 over-limit descriptions - #46519
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for tightening the short descriptions; current main still truncates them in agent/skill_utils.py:777-778, and the targeted optional skills still carry long frontmatter values.
Problems
agent/skill_utils.py:655strips every value beginning withdescription:. The helper only receives a dictionary, so valid text such asDescription: setup steps.is indistinguishable from the claimed malformed-YAML recovery case and would lose its prefix.optional-skills/research/pinecone/SKILL.md:2adds a secondpineconeskill whileoptional-skills/mlops/pinecone/SKILL.md:2already uses that name. Official installs are keyed bybundle.name(hermes_cli/skills_hub.py:618-625), so the second skill is blocked unless forced.- The new Pinecone skill adds two scripts but no
tests/skillscoverage; new skills require tests, andtests/skills/test_darwinian_evolver_skill.py:72-74shows the lightweight syntax-check pattern.
Suggested changes
- Restrict the prefix handling to a parser-proven malformed-input path, or remove it.
- Rename the research skill to a distinct identifier and add frontmatter/script tests.
Automated hermes-sweeper review.
| @@ -650,6 +650,10 @@ def extract_skill_description(frontmatter: Dict[str, Any]) -> str: | |||
| if not raw_desc: | |||
| return "" | |||
| desc = str(raw_desc).strip().strip("'\"") | |||
| # Guard against malformed YAML that duplicates the key as a value prefix | |||
| # (e.g. `description: description: "actual text"`) | |||
| if desc.lower().startswith("description:"): | |||
There was a problem hiding this comment.
extract_skill_description() gets only a parsed dictionary, so this also strips a legitimate value such as description: "Description: setup steps.". Please remove this unconditional rewrite or limit it to a parser-proven malformed-YAML fallback path.
| @@ -0,0 +1,337 @@ | |||
| --- | |||
| name: pinecone | |||
There was a problem hiding this comment.
This duplicates the existing official pinecone skill in optional-skills/mlops/pinecone. Official installs and lock entries are keyed by bundle.name, so users cannot install both normally. Please give this distinct skill a distinct identifier.
…pts + tests - Rename research/pinecone to pinecone-research (distinct from mlops/pinecone) - Shorten mlops/pinecone description to <=60 chars - Add rag_pipeline.py and memory_manager.py scripts - Add test_pinecone_research_skill.py (10 tests: frontmatter, scripts, naming) - Remove unconditional description: prefix strip from extract_skill_description()
f74be13 to
fbfae48
Compare
|
Thanks @teknium1! I've pushed an update addressing all three pieces of feedback: Prefix strip I removed the unconditional description: prefix strip entirely, as the YAML parser bug was already fixed on main. |
|
Merged via PR #70512 — your reworked commit was cherry-picked onto current main with your authorship preserved in git history, plus a small follow-up adding the trailing periods the authoring standard requires. Thanks for addressing all three review asks (dropping the stale prefix-strip, the |
Summary
Fixes #46005 (the part that remains actionable after the YAML duplicate-prefix bug was resolved in main).
agent/skill_utils.py:extract_skill_description()now defensively strips a spuriousdescription:prefix from the parsed value — a regression guard against malformed YAML that duplicates the key (e.g.description: description: "actual text"). Prevents the silent truncation to broken strings likedescription: "Use when runni..."if the YAML generation bug ever reappears.15
optional-skills/SKILL.md files brought into compliance with the ≤60-char description standard from AGENTS.md. The affected skills had descriptions ranging from 164–414 characters that were being silently truncated to garbage byextract_skill_description(), breaking skill routing (the agent sees"Managed vector database for persiste..."instead of a useful description). Fixed skills:whisper,faiss,chroma,pinecone(×2),clip,llava,peft,flash-attention,nemo-curator,huggingface-tokenizers,guidance,honcho,mcporter,adversarial-ux-test.9 unit tests added to
tests/agent/test_skill_utils.pycovering normal, edge-case, and regression paths forextract_skill_description()(previously untested).Test plan
scripts/run_tests.sh tests/agent/test_skill_utils.py— all 26 tests pass (17 existing + 9 new)