feat: Add retry mechanism for blocked tasks

Blocked tasks (from spawn failures) were a dead-end with no way to
recover. Add retryBlockedTask to DispatchManager that resets status
to pending and re-queues, a tRPC mutation that also kicks dispatchNext,
and a Retry button in the task slide-over when status is blocked.
This commit is contained in:
Lukas May
2026-03-05 20:41:49 +01:00
parent 2eac5b9908
commit d81e0864f7
6 changed files with 70 additions and 12 deletions

View File

@@ -68,6 +68,7 @@ InitiativeReviewApprovedEvent { initiativeId, branch, strategy: 'push_branch' |
6. **Planning skip** — Planning-category tasks (research, discuss, plan, detail, refine) skip auto-dispatch — they use the architect flow
7. **Summary propagation**`completeTask()` reads the completing agent's `result.message` and stores it on the task's `summary` column. Dependent tasks see this summary in `context/tasks/<id>.md` frontmatter.
8. **Spawn failure** — If `agentManager.spawn()` throws, the task is blocked via `blockTask()` with the error message. The dispatch cycle continues instead of crashing.
9. **Retry blocked**`retryBlockedTask(taskId)` resets a blocked task to pending and re-queues it. Exposed via tRPC `retryBlockedTask` mutation. The UI shows a Retry button in the task slide-over when status is `blocked`.
### DispatchManager Methods
@@ -78,6 +79,7 @@ InitiativeReviewApprovedEvent { initiativeId, branch, strategy: 'push_branch' |
| `getNextDispatchable()` | Get next task without dispatching |
| `completeTask(taskId, agentId?)` | Complete task |
| `blockTask(taskId, reason)` | Block task with reason |
| `retryBlockedTask(taskId)` | Reset blocked task to pending and re-queue |
| `getQueueState()` | Return queued, ready, blocked tasks |
## Phase Dispatch