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:
@@ -358,7 +358,7 @@ def build_skills_system_prompt(
|
|||||||
continue
|
continue
|
||||||
# Extract conditions inline from already-parsed frontmatter
|
# Extract conditions inline from already-parsed frontmatter
|
||||||
# (avoids redundant file re-read that _read_skill_conditions would do)
|
# (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 = {
|
conditions = {
|
||||||
"fallback_for_toolsets": hermes_meta.get("fallback_for_toolsets", []),
|
"fallback_for_toolsets": hermes_meta.get("fallback_for_toolsets", []),
|
||||||
"requires_toolsets": hermes_meta.get("requires_toolsets", []),
|
"requires_toolsets": hermes_meta.get("requires_toolsets", []),
|
||||||
|
|||||||
Reference in New Issue
Block a user