fix(dispatch): Filter planning-category tasks from dispatch pipeline and agent context

Planning tasks (research, discuss, plan, detail, refine) have their own
architect flow and should never enter the dispatch pipeline or clutter
agent context. Three changes:

1. Phase auto-queue skips planning-category tasks
2. Safety net in getNextDispatchable() skips planning tasks
3. gatherInitiativeContext() filters to execution tasks only
This commit is contained in:
Lukas May
2026-02-10 11:18:17 +01:00
parent d18c3c7e44
commit fc3039a147
5 changed files with 20 additions and 9 deletions

View File

@@ -56,8 +56,9 @@ AccountCredentialsRefreshedEvent { accountId, expiresAt, previousExpiresAt? }
2. **Dispatch**`dispatchNext()` finds highest-priority task with all deps complete
3. **Priority order**: high > medium > low, then oldest first (FIFO within priority)
4. **Checkpoint skip** — Tasks with type starting with `checkpoint:` skip auto-dispatch
5. **Approval check**`completeTask()` checks `requiresApproval` (task-level, then initiative-level)
6. **Approval flow**If approval required: status → `pending_approval`, emit `task:pending_approval`
5. **Planning skip** — Planning-category tasks (research, discuss, plan, detail, refine) skip auto-dispatch — they use the architect flow
6. **Approval check**`completeTask()` checks `requiresApproval` (task-level, then initiative-level)
7. **Approval flow** — If approval required: status → `pending_approval`, emit `task:pending_approval`
### DispatchManager Methods
@@ -77,7 +78,7 @@ AccountCredentialsRefreshedEvent { accountId, expiresAt, previousExpiresAt? }
1. **Queue**`queuePhase(phaseId)` validates phase is approved, gets dependencies
2. **Dispatch**`dispatchNextPhase()` finds phase with all deps complete
3. **Auto-queue tasks** — When phase starts, all pending tasks are queued
3. **Auto-queue tasks** — When phase starts, pending execution tasks are queued (planning-category tasks excluded)
4. **Events**`phase:queued`, `phase:started`, `phase:completed`, `phase:blocked`
### PhaseDispatchManager Methods