From 4b17c2411ab2518fabe9d87872a03a47d3b8cfcc Mon Sep 17 00:00:00 2001 From: 0xchainer <109617724+0xchainer@users.noreply.github.com> 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 c8b7d039c46..42e7c857434 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