feat(agent-office): GET /agents/{id}/tasks에 task_type/days 필터 추가

This commit is contained in:
2026-05-23 02:11:28 +09:00
parent 2ce6721c35
commit 918151bda8

View File

@@ -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):