fix(boulder-state): make completeBoulder idempotent on already-completed works

This commit is contained in:
YeonGyu-Kim
2026-05-11 14:25:06 +09:00
parent 70351534d0
commit ce2f3af001
2 changed files with 25 additions and 0 deletions
+4
View File
@@ -955,6 +955,10 @@ export function completeBoulder(directory: string, workId?: string, endedAt?: st
return null
}
if (work.status === "completed" && work.ended_at !== undefined && work.elapsed_ms !== undefined) {
return state
}
const endAt = endedAt ?? nowIsoString()
work.ended_at = endAt
work.elapsed_ms = getElapsedMs(work.started_at, endAt)