fix(worker): document and test Queued→Failed guard in FailAsync
OverrideSlotService dispatches RunAsync before calling StartRunningAsync, so a preflight failure (list not found, worktree setup) can reach MarkFailed while the task is still Queued. The guard is intentional, not dead code. - Add comment in FailAsync explaining the OverrideSlotService preflight gap - Add FailAsync_FromQueued_TransitionsToFailed test - Update CLAUDE.md transition table with the precise rationale Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -69,7 +69,7 @@ Allowed transitions (enforced by `TaskStateService`):
|
||||
|
||||
```
|
||||
Idle → Queued | Running (RunNow)
|
||||
Queued → Running | Cancelled | Idle | Failed (runner guard)
|
||||
Queued → Running | Cancelled | Idle | Failed (OverrideSlotService preflight gap: RunAsync can fail before StartRunningAsync is called)
|
||||
Running → WaitingForReview (standalone success, no children)
|
||||
| WaitingForChildren (parent with pending children)
|
||||
| Done (planning/improvement child success) | Failed | Cancelled
|
||||
|
||||
Reference in New Issue
Block a user