fix: await get_all() in registry router and align get_all key names

The /registry/agents endpoint was 500 on every call because
AgentRegistry.get_all() is async but was called without await.
Also aligns get_all() dict keys (name, domain) with what the router reads.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Carlos Garcia
2026-05-16 13:38:06 -04:00
parent d87f3c3e99
commit cf3fe5e0a5
2 changed files with 3 additions and 2 deletions

View File

@@ -62,9 +62,10 @@ class AgentRegistry:
async def get_all(self):
return [
{
'name': k,
'agent_key': k,
'domain': self._capabilities.get(k, ''),
'active': k in self._active,
'capabilities_summary': self._capabilities.get(k, ''),
'has_instance': k in self._agents,
}
for k in self._agents

View File

@@ -31,7 +31,7 @@ async def list_agents():
llm_router = get_llm_router()
if registry is None:
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail='Registry not ready')
agents = registry.get_all()
agents = await registry.get_all()
result = []
for agent in agents:
backend = 'ollama'