fix: conflict resolution tasks now get dispatched instead of permanently blocking initiative

- Remove original task blocking in handleConflict (task is already completed by handleAgentStopped)
- Return created conflict task from handleConflict so orchestrator can queue it for dispatch
- Add dedup check to prevent duplicate resolution tasks on crash retries
- Queue conflict resolution task via dispatchManager in mergeTaskIntoPhase
- Add recovery for erroneously blocked tasks in recoverDispatchQueues
- Update tests and docs
This commit is contained in:
Lukas May
2026-03-06 20:37:29 +01:00
parent a41caa633b
commit d4a28713f6
7 changed files with 103 additions and 28 deletions

View File

@@ -357,9 +357,10 @@ describe('E2E Edge Cases', () => {
await harness.coordinationManager.queueMerge(taskAId);
await harness.coordinationManager.processMerges('main');
// Verify: original task is now blocked
// Verify: original task is NOT blocked (stays completed — the pending
// resolution task prevents premature phase completion)
const originalTask = await harness.taskRepository.findById(taskAId);
expect(originalTask?.status).toBe('blocked');
expect(originalTask?.status).toBe('completed');
// Verify: task:queued event emitted for conflict resolution task
const queuedEvents = harness.getEventsByType('task:queued');

View File

@@ -85,12 +85,10 @@ describe('E2E Extended Scenarios', () => {
expect(conflictPayload.taskId).toBe(taskAId);
expect(conflictPayload.conflictingFiles).toEqual(['src/shared.ts', 'src/types.ts']);
// Verify: original task marked blocked
// Verify: original task is NOT blocked (stays completed — the pending
// resolution task prevents premature phase completion)
const originalTask = await harness.taskRepository.findById(taskAId);
expect(originalTask?.status).toBe('blocked');
// Note: CoordinationManager.handleConflict updates task status to blocked
// but does not emit task:blocked event (that's emitted by DispatchManager.blockTask)
expect(originalTask?.status).toBe('completed');
// Verify: task:queued event emitted for resolution task
const queuedEvents = harness.getEventsByType('task:queued');