Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4debd7d2ef | |||
| c8e24eb720 |
@@ -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
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user