Skip to content

Commit 759d822

Browse files
Davide Gallitelliclaude
andcommitted
fix(skills): update set_available_skills docstring, add duplicate URL test
- Mention HTTPS URL support in set_available_skills docstring - Add test for duplicate skill names from URL sources (Codecov gap) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8db72a7 commit 759d822

2 files changed

Lines changed: 25 additions & 2 deletions

File tree

src/strands/vended_plugins/skills/agent_skills.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ def set_available_skills(self, skills: SkillSources) -> None:
177177
"""Set the available skills, replacing any existing ones.
178178
179179
Each element can be a ``Skill`` instance, a ``str`` or ``Path`` to a
180-
skill directory (containing SKILL.md), or a ``str`` or ``Path`` to a
181-
parent directory containing skill subdirectories.
180+
skill directory (containing SKILL.md), a ``str`` or ``Path`` to a
181+
parent directory containing skill subdirectories, or an ``https://``
182+
URL pointing directly to raw SKILL.md content.
182183
183184
Note: this does not persist state or deactivate skills on any agent.
184185
Active skill state is managed per-agent and will be reconciled on the

tests/strands/vended_plugins/skills/test_agent_skills.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,28 @@ def test_resolve_url_failure_skips_gracefully(self, caplog):
727727
assert len(plugin.get_available_skills()) == 0
728728
assert "failed to load skill from URL" in caplog.text
729729

730+
def test_resolve_duplicate_url_skills_warns(self, caplog):
731+
"""Test that duplicate skill names from URLs log a warning."""
732+
import logging
733+
from unittest.mock import patch
734+
735+
with (
736+
patch(
737+
f"{self._SKILL_MODULE}.urllib.request.urlopen",
738+
return_value=self._mock_urlopen(self._SAMPLE_CONTENT),
739+
),
740+
caplog.at_level(logging.WARNING),
741+
):
742+
plugin = AgentSkills(
743+
skills=[
744+
"https://example.com/a/SKILL.md",
745+
"https://example.com/b/SKILL.md",
746+
]
747+
)
748+
749+
assert len(plugin.get_available_skills()) == 1
750+
assert "duplicate skill name" in caplog.text
751+
730752

731753
class TestImports:
732754
"""Tests for module imports."""

0 commit comments

Comments
 (0)