Make Matrix agent registry immutable

This commit is contained in:
Mikhail Putilovskij 2026-04-24 13:08:25 +03:00
parent 2fb6c10a5a
commit 25aa5d9313
2 changed files with 38 additions and 2 deletions

View file

@ -19,8 +19,8 @@ class AgentDefinition:
class AgentRegistry:
def __init__(self, agents: list[AgentDefinition]) -> None:
self.agents = agents
self._by_id = {agent.agent_id: agent for agent in agents}
self.agents = tuple(agents)
self._by_id = {agent.agent_id: agent for agent in self.agents}
def get(self, agent_id: str) -> AgentDefinition:
try: