mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-09-01 00:31:51 +03:00
fix(agent): keep default prompt paths relative
This commit is contained in:
@@ -298,7 +298,7 @@ def test_disabled_skills_excluded_from_build_skills_summary(tmp_path: Path) -> N
|
||||
assert "beta" in summary
|
||||
|
||||
|
||||
def test_build_skills_summary_groups_paths_by_root(tmp_path: Path) -> None:
|
||||
def test_build_skills_summary_uses_relative_roots_in_agent_workspace(tmp_path: Path) -> None:
|
||||
workspace = tmp_path / "ws"
|
||||
workspace_skills = workspace / "skills"
|
||||
workspace_skills.mkdir(parents=True)
|
||||
@@ -308,14 +308,34 @@ def test_build_skills_summary_groups_paths_by_root(tmp_path: Path) -> None:
|
||||
|
||||
summary = SkillsLoader(workspace, builtin_skills_dir=builtin).build_skills_summary()
|
||||
|
||||
assert summary.count(str(workspace_skills)) == 1
|
||||
assert summary.count(str(builtin)) == 1
|
||||
assert str(workspace_skills) not in summary
|
||||
assert str(builtin) not in summary
|
||||
assert str(workspace_path) not in summary
|
||||
assert str(builtin_path) not in summary
|
||||
assert summary.count("(`skills`)") == 2
|
||||
assert "`alpha/SKILL.md`" in summary
|
||||
assert "`beta/SKILL.md`" in summary
|
||||
|
||||
|
||||
def test_build_skills_summary_keeps_absolute_roots_for_selected_project(tmp_path: Path) -> None:
|
||||
workspace = tmp_path / "ws"
|
||||
workspace_skills = workspace / "skills"
|
||||
workspace_skills.mkdir(parents=True)
|
||||
_write_skill(workspace_skills, "alpha", body="# Alpha")
|
||||
builtin = tmp_path / "builtin"
|
||||
_write_skill(builtin, "beta", body="# Beta")
|
||||
project = tmp_path / "project"
|
||||
project.mkdir()
|
||||
|
||||
summary = SkillsLoader(workspace, builtin_skills_dir=builtin).build_skills_summary(
|
||||
workspace=project,
|
||||
)
|
||||
|
||||
assert summary.count(str(workspace_skills.resolve())) == 1
|
||||
assert summary.count(str(builtin.resolve())) == 1
|
||||
assert str(project.resolve()) not in summary
|
||||
|
||||
|
||||
def test_bundled_update_setup_description_is_valid_yaml(tmp_path: Path) -> None:
|
||||
metadata = SkillsLoader(tmp_path).get_skill_metadata("update-setup")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user