fix: serialize datetime objects in agent dict before JSON encoding in create_agent_execution
Deploy Dashboard (Dev) / deploy-dev (push) Successful in 2m24s
Run Tests / Backend Tests (push) Failing after 24s
Run Tests / Frontend Tests (push) Failing after 1m2s
Run Tests / Test Summary (push) Failing after 41s

This commit is contained in:
Gan, Jimmy
2026-04-02 21:55:13 +08:00
parent bdeaa7ccea
commit 971cf34087
+6 -1
View File
@@ -543,9 +543,14 @@ async def create_agent_execution(
if task_for_context.get(key): 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] task_for_context[key] = task_for_context[key].isoformat() if hasattr(task_for_context[key], 'isoformat') else task_for_context[key]
agent_for_context = dict(agent)
for key in ["created_at"]:
if agent_for_context.get(key):
agent_for_context[key] = agent_for_context[key].isoformat() if hasattr(agent_for_context[key], 'isoformat') else agent_for_context[key]
input_context = { input_context = {
"task": task_for_context, "task": task_for_context,
"agent": dict(agent), "agent": agent_for_context,
"timestamp": datetime.utcnow().isoformat() "timestamp": datetime.utcnow().isoformat()
} }