From 877d01ba50e8f24d65b6667cfccef35d2e9e35af Mon Sep 17 00:00:00 2001 From: msl Date: Sun, 17 May 2026 01:08:53 +0300 Subject: [PATCH] fix(skills): return None instead of truthy stub when skill load fails build_skill_invocation_message() returns a non-empty placeholder string ('[Failed to load skill: ...]') when the skill exists in the command cache but loading the actual SKILL.md payload fails. CLI/gateway callers treat any truthy return value as success, so the failure is silently routed into the model as if it were a valid skill prompt. Return None instead, matching the existing behavior for unknown commands, so callers using 'if msg:' can properly detect the failure. --- agent/skill_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/skill_commands.py b/agent/skill_commands.py index c8b7d039c4..42e7c85743 100644 --- a/agent/skill_commands.py +++ b/agent/skill_commands.py @@ -425,7 +425,7 @@ def build_skill_invocation_message( loaded = _load_skill_payload(skill_info["skill_dir"], task_id=task_id) if not loaded: - return f"[Failed to load skill: {skill_info['name']}]" + return None loaded_skill, skill_dir, skill_name = loaded