mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
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:
parent
1c7b71bcce
commit
5b60717133
1 changed files with 10 additions and 6 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue