fix: recover in_progress phases where all tasks are already completed on server restart

This commit is contained in:
Lukas May
2026-03-06 20:41:26 +01:00
parent 54673a4399
commit afdc1c7e00
2 changed files with 11 additions and 1 deletions

View File

@@ -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++;
}
}
}
}