Skip to content

Commit 4977f35

Browse files
committed
docs(skills): clarify LocalDirLazySkillSource host paths
1 parent 656baf8 commit 4977f35

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

src/agents/sandbox/capabilities/skills.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,17 @@ async def load_skill(
205205
src_root = self._src_root(source_grants=source_grants)
206206
if src_root is None:
207207
raise SkillsConfigError(
208-
message="lazy skill source directory is unavailable",
209-
context={"skill_name": skill_name},
208+
message=(
209+
"lazy skill source directory is unavailable; "
210+
"LocalDirLazySkillSource expects a host filesystem path, not a path "
211+
"inside the sandbox"
212+
),
213+
context={
214+
"skill_name": skill_name,
215+
"configured_source_path": None
216+
if self.source.src is None
217+
else str(self.source.src),
218+
},
210219
)
211220

212221
matches = [

tests/sandbox/capabilities/test_skills_capability.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,9 +623,19 @@ async def test_load_skill_rejects_missing_lazy_source_directory(self, tmp_path:
623623
)
624624
)
625625

626-
with pytest.raises(SkillsConfigError):
626+
with pytest.raises(SkillsConfigError) as exc_info:
627627
await capability.load_skill("missing-skill")
628628

629+
assert (
630+
exc_info.value.message
631+
== "lazy skill source directory is unavailable; "
632+
"LocalDirLazySkillSource expects a host filesystem path, not a path inside the sandbox"
633+
)
634+
assert exc_info.value.context == {
635+
"skill_name": "missing-skill",
636+
"configured_source_path": str(tmp_path / "missing-skills"),
637+
}
638+
629639
@pytest.mark.asyncio
630640
async def test_load_skill_rejects_ambiguous_skill_name(self, tmp_path: Path) -> None:
631641
workspace_root = tmp_path / "workspace"

0 commit comments

Comments
 (0)