diff --git a/apps/server/execution/orchestrator.ts b/apps/server/execution/orchestrator.ts index 4ab94e0..97520be 100644 --- a/apps/server/execution/orchestrator.ts +++ b/apps/server/execution/orchestrator.ts @@ -353,7 +353,11 @@ export class ExecutionOrchestrator { if (initiative.executionMode === 'yolo') { // Merge phase branch into initiative branch (only when branches exist) if (initiative.branch) { - await this.mergePhaseIntoInitiative(phaseId); + try { + await this.mergePhaseIntoInitiative(phaseId); + } catch (err) { + log.error({ phaseId, err: err instanceof Error ? err.message : String(err) }, 'phase merge failed, completing phase anyway'); + } } await this.phaseDispatchManager.completePhase(phaseId); @@ -663,6 +667,7 @@ export class ExecutionOrchestrator { const phases = await this.phaseRepository.findByInitiativeId(initiative.id); for (const phase of phases) { + try { // Re-queue approved phases into the phase dispatch queue if (phase.status === 'approved') { try { @@ -734,6 +739,9 @@ export class ExecutionOrchestrator { phasesRecovered++; } } + } catch (err) { + log.error({ phaseId: phase.id, err: err instanceof Error ? err.message : String(err) }, 'phase recovery failed, continuing with remaining phases'); + } } }