Fail zombie studio jobs when Comfy's queue is empty after a restart.

A live job stuck at 8% with no Comfy prompt was treated as still owning the GPU, so waiting work never started.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-03 16:07:36 -05:00
co-authored by Cursor
parent 110865b370
commit b5014f02b4
2 changed files with 61 additions and 8 deletions
+3 -1
View File
@@ -480,9 +480,11 @@ export async function isComfyPromptDropped(promptId: string) {
if (queue.running > 0 || queue.pending > 0) return false
const history = await fetchHistory(promptId)
const entry = history?.[promptId] as { status?: { status_str?: string; completed?: boolean } } | undefined
if (!entry) return false
// Empty Comfy + no history for this id: wiped by restart/clear, or never accepted.
if (!entry) return true
const inspected = inspectHistory(history, promptId)
if (inspected.video) return false
if (extractAudio(history, promptId)) return false
const status = entry.status?.status_str
if (status === 'error' || status === 'interrupted') return true
if (entry.status?.completed) return true