diff --git a/agent-office/app/main.py b/agent-office/app/main.py index 75d34b7..ef70bc1 100644 --- a/agent-office/app/main.py +++ b/agent-office/app/main.py @@ -1,5 +1,6 @@ import os import json +from typing import Optional from fastapi import FastAPI, HTTPException, WebSocket, WebSocketDisconnect from fastapi.middleware.cors import CORSMiddleware @@ -104,8 +105,13 @@ def update_agent(agent_id: str, body: AgentConfigUpdate): return {"ok": True} @app.get("/api/agent-office/agents/{agent_id}/tasks") -def agent_tasks(agent_id: str, limit: int = 20): - return {"tasks": get_agent_tasks(agent_id, limit)} +def agent_tasks( + agent_id: str, + limit: int = 20, + task_type: Optional[str] = None, + days: Optional[int] = None, +): + return {"items": get_agent_tasks(agent_id, limit=limit, task_type=task_type, days=days)} @app.get("/api/agent-office/agents/{agent_id}/logs") def agent_logs(agent_id: str, limit: int = 50):