Reject non-mapping agent registry entries

This commit is contained in:
Mikhail Putilovskij 2026-04-24 12:57:00 +03:00
parent 37f7ce27a2
commit b53523ad6c
2 changed files with 15 additions and 0 deletions

View file

@ -35,3 +35,15 @@ def test_load_agent_registry_rejects_duplicate_ids(tmp_path: Path):
with pytest.raises(AgentRegistryError, match="duplicate agent id"):
load_agent_registry(path)
def test_load_agent_registry_rejects_non_mapping_entries(tmp_path: Path):
path = tmp_path / "agents.yaml"
path.write_text(
"agents:\n"
" - agent-1\n",
encoding="utf-8",
)
with pytest.raises(AgentRegistryError, match="each agent entry requires id and label"):
load_agent_registry(path)