diff --git a/apps/frontend/src/main/task-state-manager.ts b/apps/frontend/src/main/task-state-manager.ts index fffb7beab0..b26c23a1ff 100644 --- a/apps/frontend/src/main/task-state-manager.ts +++ b/apps/frontend/src/main/task-state-manager.ts @@ -362,17 +362,22 @@ export class TaskStateManager { const phase = XSTATE_TO_PHASE[xstateState] || 'idle'; - // Emit execution progress with the phase derived from XState + // Emit execution progress with the phase derived from XState. + // IMPORTANT: Do NOT use Date.now() as sequenceNumber here — doing so would + // permanently block all subsequent agent execution-progress events, because + // the agent uses small sequential integers (1, 2, 3…) that are always less + // than a timestamp. Instead emit with sequenceNumber=0 so the agent's own + // events can continue updating phaseProgress once the phase is established. safeSendToRenderer( this.getMainWindow, IPC_CHANNELS.TASK_EXECUTION_PROGRESS, taskId, { phase, - phaseProgress: phase === 'complete' ? 100 : 50, - overallProgress: phase === 'complete' ? 100 : 50, + phaseProgress: phase === 'complete' ? 100 : 0, + overallProgress: phase === 'complete' ? 100 : 0, message: `State: ${xstateState}`, - sequenceNumber: Date.now() // Use timestamp as sequence to ensure it's newer + sequenceNumber: 0 }, projectId );