fix the unit tests error of agent provider

This commit is contained in:
Willem Jiang
2026-04-26 22:09:12 +08:00
parent ac18b9c424
commit 60754f0c50
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -84,7 +84,7 @@ def test_refresh_skills_system_prompt_cache_async_reloads_immediately(monkeypatc
state = {"skills": [make_skill("first-skill")]}
monkeypatch.setattr(prompt_module, "load_skills", lambda enabled_only=True: list(state["skills"]))
prompt_module._reset_skills_system_prompt_cache_state()
prompt_module.clear_skills_system_prompt_cache()
try:
prompt_module.warm_enabled_skills_cache()
@@ -95,7 +95,7 @@ def test_refresh_skills_system_prompt_cache_async_reloads_immediately(monkeypatc
assert [skill.name for skill in prompt_module._get_enabled_skills()] == ["second-skill"]
finally:
prompt_module._reset_skills_system_prompt_cache_state()
prompt_module.clear_skills_system_prompt_cache()
def test_clear_cache_does_not_spawn_parallel_refresh_workers(monkeypatch, tmp_path):
@@ -137,7 +137,7 @@ def test_clear_cache_does_not_spawn_parallel_refresh_workers(monkeypatch, tmp_pa
return [make_skill(f"skill-{current_call}")]
monkeypatch.setattr(prompt_module, "load_skills", fake_load_skills)
prompt_module._reset_skills_system_prompt_cache_state()
prompt_module.clear_skills_system_prompt_cache()
try:
prompt_module.clear_skills_system_prompt_cache()
@@ -151,7 +151,7 @@ def test_clear_cache_does_not_spawn_parallel_refresh_workers(monkeypatch, tmp_pa
assert [skill.name for skill in prompt_module._get_enabled_skills()] == ["skill-2"]
finally:
release.set()
prompt_module._reset_skills_system_prompt_cache_state()
prompt_module.clear_skills_system_prompt_cache()
def test_warm_enabled_skills_cache_logs_on_timeout(monkeypatch, caplog):