diff --git a/agent/skill_utils.py b/agent/skill_utils.py index 6b83852eaaa..23c8d99c997 100644 --- a/agent/skill_utils.py +++ b/agent/skill_utils.py @@ -556,6 +556,11 @@ def normalize_skill_lookup_name(identifier: str) -> str: try: return str(identifier_path.resolve().relative_to(primary_root.resolve())) except Exception: + logger.debug( + "Skill identifier %r is an absolute path outside trusted skills " + "roots — passing through unchanged (skill_view will reject it)", + raw_identifier, + ) return raw_identifier diff --git a/tests/agent/test_skill_utils.py b/tests/agent/test_skill_utils.py index 8439253d523..347d1b667c7 100644 --- a/tests/agent/test_skill_utils.py +++ b/tests/agent/test_skill_utils.py @@ -339,7 +339,7 @@ class TestNormalizeSkillLookupName: def test_relative_path_unchanged(self, tmp_path, monkeypatch): from agent.skill_utils import normalize_skill_lookup_name - monkeypatch.setattr("agent.skill_utils.get_skills_dir", lambda: tmp_path / "skills") + # Relative identifiers early-return before any root lookup. assert normalize_skill_lookup_name("foo/bar") == "foo/bar" def test_absolute_under_skills_dir_becomes_relative(self, tmp_path, monkeypatch):