fix(skills): return None instead of truthy stub when skill load fails#27147
fix(skills): return None instead of truthy stub when skill load fails#271470xchainer wants to merge 2 commits into
Conversation
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.
This comment was marked as spam.
This comment was marked as spam.
Add test_returns_none_when_skill_load_fails to verify that build_skill_invocation_message() returns None when a registered skill exists in the command cache but _load_skill_payload() fails. This guards against regression of the fix in 877d01b.
Tests Added
|
|
Merged via #27290 with your authorship preserved via rebase-merge. Commit |
…tors Adds release-note attribution mappings for 9 contributors from group 4: - @EloquentBrush0x (PR #26657) - @subtract0 (PR #25658) - @zwolniony (PR #26961) - @that-ambuj (PR #26582) - @zccyman (PR #25294) - @lidge-jun (PR #26814) - @phoenixshen (PR #26768) - @AhmetArif0 (PR #26635) - (francip already mapped from prior PR #26134 attribution) #27147 dropped from this batch — already landed on main as 4b17c24.
…tors Adds release-note attribution mappings for 9 contributors from group 4: - @EloquentBrush0x (PR NousResearch#26657) - @subtract0 (PR NousResearch#25658) - @zwolniony (PR NousResearch#26961) - @that-ambuj (PR NousResearch#26582) - @zccyman (PR NousResearch#25294) - @lidge-jun (PR NousResearch#26814) - @phoenixshen (PR NousResearch#26768) - @AhmetArif0 (PR NousResearch#26635) - (francip already mapped from prior PR NousResearch#26134 attribution) NousResearch#27147 dropped from this batch — already landed on main as 4b17c24.
Summary
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 (usingif msg:checks), so the failure text gets injected into the model as a user prompt.What does this PR do?
Changes the failure return value from a truthy error string to
None, matching the existing behavior for unknown commands (/nonexistent→None). This way callers usingif msg:properly detect the failure instead of routing bogus prompt text to the LLM.Changes Made
agent/skill_commands.py:428—return f"[Failed to load skill: ...]"→return NoneHow to Test
SKILL.mdbuild_skill_invocation_message("/skill-name", "hello")None→ callers detect failure properlyChecklist