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:
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user