From d218cf91180f2418777a8985073ebb50f8ae8143 Mon Sep 17 00:00:00 2001 From: Teknium Date: Wed, 25 Mar 2026 16:06:15 -0700 Subject: [PATCH] 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 --- agent/prompt_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/prompt_builder.py b/agent/prompt_builder.py index 640a2ddb..c47d98aa 100644 --- a/agent/prompt_builder.py +++ b/agent/prompt_builder.py @@ -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", []),