mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-27 01:11:40 +00:00
fix(agent): refresh skills prompt cache when disabled skills change
This commit is contained in:
parent
7e3b356574
commit
fd119a1c4a
2 changed files with 20 additions and 2 deletions
|
|
@ -354,6 +354,24 @@ class TestBuildSkillsSystemPrompt:
|
|||
assert "web-search" in result
|
||||
assert "old-tool" not in result
|
||||
|
||||
def test_rebuilds_prompt_when_disabled_skills_change(self, monkeypatch, tmp_path):
|
||||
monkeypatch.setenv("HERMES_HOME", str(tmp_path))
|
||||
skill_dir = tmp_path / "skills" / "tools" / "cached-skill"
|
||||
skill_dir.mkdir(parents=True)
|
||||
(skill_dir / "SKILL.md").write_text(
|
||||
"---\nname: cached-skill\ndescription: Cached skill\n---\n"
|
||||
)
|
||||
|
||||
first = build_skills_system_prompt()
|
||||
assert "cached-skill" in first
|
||||
|
||||
(tmp_path / "config.yaml").write_text(
|
||||
"skills:\n disabled: [cached-skill]\n"
|
||||
)
|
||||
|
||||
second = build_skills_system_prompt()
|
||||
assert "cached-skill" not in second
|
||||
|
||||
def test_includes_setup_needed_skills(self, monkeypatch, tmp_path):
|
||||
monkeypatch.setenv("HERMES_HOME", str(tmp_path))
|
||||
monkeypatch.delenv("MISSING_API_KEY_XYZ", raising=False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue