fix(worker): allow the done toggle from any non-Running status
MarkDoneAsync was Idle-only, so a finished task (typically a list-handler run with no worktree to merge) could not be ticked off. Guard on Running instead and cover the other statuses with tests.
This commit is contained in:
@@ -70,7 +70,7 @@ not conflated.
|
||||
Allowed transitions (enforced by `TaskStateService`):
|
||||
|
||||
```
|
||||
Idle → Queued | Running (RunNow) | Done (manual toggle) | Cancelled (external update_task_status only, allowFromIdle: true)
|
||||
Idle → Queued | Running (RunNow) | Cancelled (external update_task_status only, allowFromIdle: true)
|
||||
Queued → Running | Cancelled | Idle | Failed (OverrideSlotService preflight gap)
|
||||
Running → WaitingForReview (standalone success, no children)
|
||||
| WaitingForChildren (parent with pending children)
|
||||
@@ -80,8 +80,14 @@ WaitingForReview → Done (approve) | Queued (reject-rerun, +feedback) | Idle
|
||||
Done → Idle (re-run)
|
||||
Failed → Idle | Queued
|
||||
Cancelled → Idle | Queued
|
||||
|
||||
any except Running → Done (manual done toggle, SetTaskDone)
|
||||
```
|
||||
|
||||
The manual done toggle is the one cross-cutting transition — it ticks a task off from **any**
|
||||
status except `Running`, skipping the merge on purpose (a worktree-less list-handler task has
|
||||
nothing to merge; a worktree task's branch just stays Active for the worktrees overview).
|
||||
|
||||
**Unified parent model.** Every parent — planning *or* improvement — flows
|
||||
`… → WaitingForChildren → WaitingForReview → Done` via the single `TryAdvanceParentAsync`.
|
||||
Planning/improvement **children** go straight to `Done`; only the parent is reviewed.
|
||||
|
||||
Reference in New Issue
Block a user