Major Features Added: - Fix Socket.IO connectivity by updating Dockerfile to use socket_app - Resolve distributed workflows API to return arrays instead of errors - Expand agent coverage from 3 to 7 agents (added OAK and ROSEWOOD) - Create comprehensive systemd service for MCP server with auto-discovery - Add daemon mode with periodic agent discovery every 5 minutes - Implement comprehensive test suite with 100% pass rate Infrastructure Improvements: - Enhanced database connection handling with retry logic - Improved agent registration with persistent storage - Added proper error handling for distributed workflows endpoint - Created management scripts for service lifecycle operations Agent Cluster Expansion: - ACACIA: deepseek-r1:7b (kernel_dev) - WALNUT: starcoder2:15b (pytorch_dev) - IRONWOOD: deepseek-coder-v2 (profiler) - OAK: codellama:latest (docs_writer) - OAK-TESTER: deepseek-r1:latest (tester) - ROSEWOOD: deepseek-coder-v2:latest (kernel_dev) - ROSEWOOD-VISION: llama3.2-vision:11b (tester) System Status: All 7 agents healthy, Socket.IO operational, MCP server fully functional 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
52 lines
1.8 KiB
Python
52 lines
1.8 KiB
Python
from fastapi import APIRouter, Depends, HTTPException, Request
|
|
from typing import List, Dict, Any
|
|
from ..core.auth import get_current_user
|
|
from ..core.hive_coordinator import Agent, AgentType
|
|
|
|
router = APIRouter()
|
|
|
|
from app.core.database import SessionLocal
|
|
from app.models.agent import Agent as ORMAgent
|
|
|
|
@router.get("/agents")
|
|
async def get_agents(request: Request, current_user: dict = Depends(get_current_user)):
|
|
"""Get all registered agents"""
|
|
with SessionLocal() as db:
|
|
db_agents = db.query(ORMAgent).all()
|
|
agents_list = []
|
|
for db_agent in db_agents:
|
|
agents_list.append({
|
|
"id": db_agent.id,
|
|
"endpoint": db_agent.endpoint,
|
|
"model": db_agent.model,
|
|
"specialty": db_agent.specialty,
|
|
"max_concurrent": db_agent.max_concurrent,
|
|
"current_tasks": db_agent.current_tasks
|
|
})
|
|
|
|
return {
|
|
"agents": agents_list,
|
|
"total": len(agents_list),
|
|
}
|
|
|
|
@router.post("/agents")
|
|
async def register_agent(agent_data: Dict[str, Any], request: Request, current_user: dict = Depends(get_current_user)):
|
|
"""Register a new agent"""
|
|
hive_coordinator = request.app.state.hive_coordinator
|
|
|
|
try:
|
|
agent = Agent(
|
|
id=agent_data["id"],
|
|
endpoint=agent_data["endpoint"],
|
|
model=agent_data["model"],
|
|
specialty=AgentType(agent_data["specialty"]),
|
|
max_concurrent=agent_data.get("max_concurrent", 2),
|
|
)
|
|
hive_coordinator.add_agent(agent)
|
|
return {
|
|
"status": "success",
|
|
"message": f"Agent {agent.id} registered successfully",
|
|
"agent_id": agent.id
|
|
}
|
|
except (KeyError, ValueError) as e:
|
|
raise HTTPException(status_code=400, detail=f"Invalid agent data: {e}") |