fix: remove duplicate get_dagi_router_agents function

This commit is contained in:
Apple
2025-12-01 06:06:35 -08:00
parent 909258fdcb
commit 9640fd5a75

View File

@@ -3543,30 +3543,7 @@ class DAGIRouterAgentsResponse(BaseModel):
agents: List[DAGIRouterAgentItem]
@router.get("/internal/node/{node_id}/dagi-router/agents", response_model=DAGIRouterAgentsResponse)
async def get_dagi_router_agents(node_id: str):
"""
Отримати агентів DAGI Router для Node Cabinet таблиці.
Повертає уніфікований список агентів зі статусами.
"""
try:
data = await repo_city.get_dagi_router_agents_for_node(node_id)
return DAGIRouterAgentsResponse(
node_id=data["node_id"],
last_audit_at=data.get("last_audit_at"),
summary=DAGIRouterAgentsSummary(**data["summary"]),
agents=[DAGIRouterAgentItem(**a) for a in data["agents"]]
)
except Exception as e:
logger.error(f"Error getting DAGI router agents for {node_id}: {e}")
# Return empty response on error
return DAGIRouterAgentsResponse(
node_id=node_id,
last_audit_at=None,
summary=DAGIRouterAgentsSummary(),
agents=[]
)
# NOTE: get_dagi_router_agents moved to internal endpoints section below
# =============================================================================