Merge pull request #97 from cabana8471-arch/fix/pydantic-datetime-serialization

fix: Pydantic datetime serialization for API endpoints
This commit is contained in:
Leon van Zyl
2026-01-26 16:07:03 +02:00
committed by GitHub
3 changed files with 4 additions and 4 deletions

View File

@@ -93,7 +93,7 @@ async def get_agent_status(project_name: str):
return AgentStatus(
status=manager.status,
pid=manager.pid,
started_at=manager.started_at,
started_at=manager.started_at.isoformat() if manager.started_at else None,
yolo_mode=manager.yolo_mode,
model=manager.model,
parallel_mode=manager.parallel_mode,

View File

@@ -129,7 +129,7 @@ async def get_devserver_status(project_name: str) -> DevServerStatus:
pid=manager.pid,
url=manager.detected_url,
command=manager._command,
started_at=manager.started_at,
started_at=manager.started_at.isoformat() if manager.started_at else None,
)

View File

@@ -256,8 +256,8 @@ async def get_next_scheduled_run(project_name: str):
return NextRunResponse(
has_schedules=True,
next_start=next_start if active_count == 0 else None,
next_end=latest_end,
next_start=next_start.isoformat() if (active_count == 0 and next_start) else None,
next_end=latest_end.isoformat() if latest_end else None,
is_currently_running=active_count > 0,
active_schedule_count=active_count,
)