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:
@@ -62,9 +62,10 @@ class AgentRegistry:
|
|||||||
async def get_all(self):
|
async def get_all(self):
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
'name': k,
|
||||||
'agent_key': k,
|
'agent_key': k,
|
||||||
|
'domain': self._capabilities.get(k, ''),
|
||||||
'active': k in self._active,
|
'active': k in self._active,
|
||||||
'capabilities_summary': self._capabilities.get(k, ''),
|
|
||||||
'has_instance': k in self._agents,
|
'has_instance': k in self._agents,
|
||||||
}
|
}
|
||||||
for k in self._agents
|
for k in self._agents
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ async def list_agents():
|
|||||||
llm_router = get_llm_router()
|
llm_router = get_llm_router()
|
||||||
if registry is None:
|
if registry is None:
|
||||||
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail='Registry not ready')
|
raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail='Registry not ready')
|
||||||
agents = registry.get_all()
|
agents = await registry.get_all()
|
||||||
result = []
|
result = []
|
||||||
for agent in agents:
|
for agent in agents:
|
||||||
backend = 'ollama'
|
backend = 'ollama'
|
||||||
|
|||||||
Reference in New Issue
Block a user