fix: serialize datetime objects before JSON encoding in create_agent_execution
Deploy Dashboard (Dev) / deploy-dev (push) Successful in 3m2s
Run Tests / Backend Tests (push) Failing after 40s
Run Tests / Frontend Tests (push) Failing after 43s
Run Tests / Test Summary (push) Failing after 42s

This commit is contained in:
Gan, Jimmy
2026-04-02 21:20:10 +08:00
parent 8c08ae32cc
commit bdeaa7ccea
+7 -1
View File
@@ -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()
}