fix: recover in_progress phases where all tasks are already completed on server restart
This commit is contained in:
@@ -631,6 +631,15 @@ export class ExecutionOrchestrator {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Re-read tasks after recovery updates and check if phase is now fully done
|
||||
const updatedTasks = await this.taskRepository.findByPhaseId(phase.id);
|
||||
const allDone = updatedTasks.every((t) => t.status === 'completed');
|
||||
if (allDone && updatedTasks.length > 0) {
|
||||
log.info({ phaseId: phase.id }, 'all tasks completed in in_progress phase, triggering phase completion');
|
||||
await this.handlePhaseAllTasksDone(phase.id);
|
||||
phasesRecovered++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user