fix: Phase completion check runs regardless of branch/merge status
handleTaskCompleted and handlePhaseAllTasksDone both bailed early when initiative had no branch, silently skipping phase status transitions. Also, merge failures would skip the phase completion check entirely. - Decouple phase completion check from branch existence - Wrap merge in try/catch so phase check runs even if merge fails - Route updateTaskStatus through dispatchManager.completeTask when completing, so the task:completed event fires for orchestration
This commit is contained in:
@@ -50,6 +50,14 @@ export function taskProcedures(publicProcedure: ProcedureBuilder) {
|
||||
message: `Task '${input.id}' not found`,
|
||||
});
|
||||
}
|
||||
|
||||
// Route through dispatchManager when completing — emits task:completed
|
||||
// event so the orchestrator can check phase completion and merge branches
|
||||
if (input.status === 'completed' && ctx.dispatchManager) {
|
||||
await ctx.dispatchManager.completeTask(input.id);
|
||||
return (await taskRepository.findById(input.id))!;
|
||||
}
|
||||
|
||||
return taskRepository.update(input.id, { status: input.status });
|
||||
}),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user