You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SKILL.md frontmatter is cut at the first "---" inside a value (description truncated or skill fails to load)聽#7725
Describe the Bug: _parse_skill_md_content (src/google/adk/skills/_utils.py) splits SKILL.md with content.split("---", 2), so the frontmatter ends at the first --- anywhere in the file, not at the closing --- line. Any --- inside a frontmatter value (a spaced em-dash in a description, a horizontal rule inside a | block scalar) cuts the frontmatter short. Every skill loader goes through this function (load_skill_from_dir, zip loading, GCS loading, SkillToolset).
Steps to Reproduce:
Create compare-skill/SKILL.md:
---
name: compare-skill
description: Compare two options --- pros, cons and a verdict.
---
# Instructions
Do the thing.
Load it with google.adk.skills.load_skill_from_dir("compare-skill").
Repeat with the description quoted: description: "Draft release notes --- never publish them."
Expected Behavior: frontmatter.description is the full string and instructions is # Instructions\nDo the thing. in both cases.
Observed Behavior:
Unquoted: description == 'Compare two options', and the rest of the description plus the real closing --- leak into the instructions: 'pros, cons and a verdict.\n---\n# Instructions\nDo the thing.'. The model sees a truncated description when choosing skills.
Quoted: the skill fails to load with ValueError: Invalid YAML in frontmatter: while scanning a quoted scalar, although the file is valid.
With a description: | block scalar containing a --- line, the description is cut and every key after it (license, metadata, allowed-tools) is silently dropped, including adk_additional_tools in metadata.
Environment Details:
ADK Library Version (pip show google-adk): 2.13.0 (main at da35ca7)
Desktop OS: Linux
Python Version (python -V): 3.12
Model Information:
Are you using LiteLLM: No
Which model is being used: N/A (happens while loading the skill, before any model call)
馃煛 Optional Information
Minimal Reproduction Code:
importpathlib, tempfilefromgoogle.adk.skillsimportload_skill_from_dird=pathlib.Path(tempfile.mkdtemp()) /"compare-skill"d.mkdir()
(d/"SKILL.md").write_text(
"---\nname: compare-skill\n""description: Compare two options --- pros, cons and a verdict.\n""---\n# Instructions\nDo the thing.\n"
)
skill=load_skill_from_dir(d)
print(repr(skill.frontmatter.description)) # 'Compare two options'print(repr(skill.instructions)) # 'pros, cons and a verdict.\n---\n# Instructions\nDo the thing.'
Additional Context:
I have a fix ready that matches the opening and closing --- as whole lines (CRLF still handled), with regression tests in tests/unittests/skills/test__utils.py, and can open a PR referencing this issue.
Activity