The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test(skills): the Hermes-index fetch rides the inspect connection pool
kshitijk4poore0cf8f7f8d20
diff --git a/tests/hermes_cli/test_skills_hub.py b/tests/hermes_cli/test_skills_hub.pyindex 4d8fbc426f5..442506360ba 100644--- a/tests/hermes_cli/test_skills_hub.py+++ b/tests/hermes_cli/test_skills_hub.py@@ -285,10 +285,11 @@ def test_resolve_keeps_catalog_meta_when_later_sources_do_not_fetch():assert matched.__class__ is CatalogSource-def test_inspect_reuses_one_ssrf_safe_client_for_metadata_and_bundle(monkeypatch):+def test_inspect_reuses_one_ssrf_safe_client_for_metadata_and_bundle(monkeypatch, tmp_path):"""A preview's sequential resolver calls must share its guarded connection pool."""import hermes_cli.skills_hub as cli_hubimport tools.skills_hub as hub+ import tools.skills_hub_search as searchfrom tools.skills_hub_models import SkillBundle, SkillMetaclients = []@@ -299,6 +300,9 @@ def test_inspect_reuses_one_ssrf_safe_client_for_metadata_and_bundle(monkeypatchcontent = b"ok"headers = {}+ def json(self):+ return {"skills": []}+class Client:def __enter__(self):return self@@ -312,6 +316,8 @@ def test_inspect_reuses_one_ssrf_safe_client_for_metadata_and_bundle(monkeypatchclass Source:def inspect(self, _identifier):hub._guarded_http_get("https://example.com/metadata")+ # The Hermes-index fetch must ride the same pool (no cache → real GET).+ assert search._load_hermes_index() == {"skills": []}return SkillMeta("example", "metadata", "test", "example/id", "community")def fetch(self, _identifier):@@ -327,6 +333,8 @@ def test_inspect_reuses_one_ssrf_safe_client_for_metadata_and_bundle(monkeypatchmonkeypatch.setattr(hub, "create_ssrf_safe_client", create_client, raising=False)monkeypatch.setattr(hub, "is_safe_url", lambda _url: True)monkeypatch.setattr(hub, "check_website_access", lambda _url: None)+ monkeypatch.setattr(search, "_hermes_index_cache_file", lambda: tmp_path / "hermes-index.json")+ monkeypatch.setattr(search.httpx, "get", lambda *_a, **_k: pytest.fail("index fetch bypassed the pool"))result = cli_hub.inspect_skill("example/id")