fix(skills): handle null metadata in skill frontmatter

frontmatter.get("metadata", {}) returns None (not {}) when the
key exists with a null value, crashing build_skills_system_prompt
with AttributeError: 'NoneType' object has no attribute 'get'.

Made-with: Cursor
This commit is contained in:
Teknium
2026-03-25 16:06:15 -07:00
parent 841401f588
commit d218cf9118

View File

@@ -358,7 +358,7 @@ def build_skills_system_prompt(
continue
# Extract conditions inline from already-parsed frontmatter
# (avoids redundant file re-read that _read_skill_conditions would do)
hermes_meta = frontmatter.get("metadata", {}).get("hermes", {})
hermes_meta = (frontmatter.get("metadata") or {}).get("hermes") or {}
conditions = {
"fallback_for_toolsets": hermes_meta.get("fallback_for_toolsets", []),
"requires_toolsets": hermes_meta.get("requires_toolsets", []),