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

@ -1,6 +1,7 @@
from __future__ import annotations
from dataclasses import dataclass
from collections.abc import Mapping
from pathlib import Path
import yaml
@ -37,6 +38,8 @@ def load_agent_registry(path: str | Path) -> AgentRegistry:
agents: list[AgentDefinition] = []
seen: set[str] = set()
for entry in entries:
if not isinstance(entry, Mapping):
raise AgentRegistryError("each agent entry requires id and label")
agent_id = str(entry.get("id", "")).strip()
label = str(entry.get("label", "")).strip()
if not agent_id or not label: