diff --git a/dashboard/backend/db/opc_db.py b/dashboard/backend/db/opc_db.py index f74423f..3b0da62 100644 --- a/dashboard/backend/db/opc_db.py +++ b/dashboard/backend/db/opc_db.py @@ -537,8 +537,14 @@ async def create_agent_execution( raise ValueError("Task or agent not found") # Build input context + # Prepare input context with serialized datetimes + task_for_context = dict(task) + for key in ["created_at", "updated_at", "completed_at", "due_date"]: + if task_for_context.get(key): + task_for_context[key] = task_for_context[key].isoformat() if hasattr(task_for_context[key], 'isoformat') else task_for_context[key] + input_context = { - "task": dict(task), + "task": task_for_context, "agent": dict(agent), "timestamp": datetime.utcnow().isoformat() }