fix: auto-assign tasks to PM agent when moved to in_progress, fix datetime serialization in WebSocket, add executor logging
Deploy Dashboard (Dev) / deploy-dev (push) Failing after 2m19s
Run Tests / Frontend Tests (push) Has been cancelled
Run Tests / Backend Tests (push) Has started running
Run Tests / Test Summary (push) Has been cancelled

This commit is contained in:
Gan, Jimmy
2026-04-02 10:22:15 +08:00
parent 21d0cd9ff6
commit 2c8f4fcd5c
3 changed files with 43 additions and 4 deletions
+24 -4
View File
@@ -74,24 +74,44 @@ async def websocket_endpoint(websocket: WebSocket):
async def broadcast_task_update(task_id: int, action: str, task_data: dict):
"""Broadcast task update to all connected clients"""
# Serialize datetime objects to ISO format
serialized_data = task_data.copy()
for key in ["created_at", "updated_at", "completed_at", "due_date"]:
if serialized_data.get(key):
serialized_data[key] = serialized_data[key].isoformat() if hasattr(serialized_data[key], 'isoformat') else serialized_data[key]
timestamp = task_data.get("updated_at")
if timestamp and hasattr(timestamp, 'isoformat'):
timestamp = timestamp.isoformat()
message = {
"type": "task_update",
"task_id": task_id,
"action": action, # created, updated, moved, deleted
"data": task_data,
"timestamp": task_data.get("updated_at")
"data": serialized_data,
"timestamp": timestamp
}
await manager.broadcast(message)
async def broadcast_agent_execution(execution_id: int, status: str, execution_data: dict):
"""Broadcast agent execution update"""
# Serialize datetime objects to ISO format
serialized_data = execution_data.copy()
for key in ["started_at", "completed_at"]:
if serialized_data.get(key):
serialized_data[key] = serialized_data[key].isoformat() if hasattr(serialized_data[key], 'isoformat') else serialized_data[key]
timestamp = execution_data.get("started_at") or execution_data.get("completed_at")
if timestamp and hasattr(timestamp, 'isoformat'):
timestamp = timestamp.isoformat()
message = {
"type": "agent_execution",
"execution_id": execution_id,
"status": status, # pending, running, completed, failed, pending_approval
"data": execution_data,
"timestamp": execution_data.get("started_at") or execution_data.get("completed_at")
"data": serialized_data,
"timestamp": timestamp
}
await manager.broadcast(message)