A run with finished and queued batches rolls up in progress, not waiting 🟩

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-07 11:04:50 +00:00
parent 1c7b71bcce
commit 5b60717133

View file

@ -70,11 +70,12 @@ class Task:
def recalculate_from_subtasks(self, statuses: list[SubTaskStatus]) -> None:
"""Recompute Task.status from its SubTasks' statuses.
Rule (preserved from legacy _update_task_progress):
- any FAILED FAILED
- all COMPLETE COMPLETE
- any IN_PROGRESS IN_PROGRESS
- otherwise WAITING
Rule:
- any FAILED FAILED
- all COMPLETE COMPLETE
- any IN_PROGRESS or COMPLETE IN_PROGRESS (finished batches plus
queued batches is a run in progress, not a waiting one ADR-0055)
- all WAITING WAITING
Empty list is a no-op (newly-created task with no subtasks).
"""
@ -87,7 +88,10 @@ class Task:
elif all(s is SubTaskStatus.COMPLETE for s in statuses):
self.status = TaskStatus.COMPLETE
self.job_completed = now
elif SubTaskStatus.IN_PROGRESS in statuses:
elif (
SubTaskStatus.IN_PROGRESS in statuses
or SubTaskStatus.COMPLETE in statuses
):
self.status = TaskStatus.IN_PROGRESS
self.job_completed = None
else: