fix(api): completedAt: null on non-complete states + OpenAPI timestamps & rate-limit headers (#29)

This commit is contained in:
2026-03-18 21:49:51 -04:00
parent b929e6d72f
commit ea4cddc2ad
2 changed files with 60 additions and 1 deletions

View File

@@ -309,6 +309,7 @@ router.get("/jobs/:id", async (req: Request, res: Response) => {
jobId: job.id,
state: job.state,
createdAt: job.createdAt.toISOString(),
completedAt: job.state === "complete" ? job.updatedAt.toISOString() : null,
};
switch (job.state) {
@@ -356,7 +357,6 @@ router.get("/jobs/:id", async (req: Request, res: Response) => {
case "complete":
res.json({
...base,
completedAt: job.updatedAt.toISOString(),
result: job.result ?? undefined,
...(job.actualCostUsd != null ? {
costLedger: {