-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: sync kanban card stage with live agent phase #1890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| }, | ||
|
Comment on lines
+365
to
381
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: rg -n "updateExecutionProgress|incomingSeq|currentSeq|sequenceNumber" --type ts --type tsx -C 3 apps/frontend/src/renderer/Repository: AndyMik90/Auto-Claude Length of output: 92 🏁 Script executed: rg -n "updateExecutionProgress|incomingSeq|currentSeq" apps/frontend/src/renderer/ -C 3Repository: AndyMik90/Auto-Claude Length of output: 8389 🏁 Script executed: sed -n '416,460p' apps/frontend/src/renderer/stores/task-store.tsRepository: AndyMik90/Auto-Claude Length of output: 1875 Sequence guard doesn't filter The renderer's sequence guard at line 435 of This means every XState mid-task transition (e.g., Either update the renderer's guard to explicitly drop if ((incomingSeq === 0 && currentSeq > 0) || (incomingSeq > 0 && currentSeq > 0 && incomingSeq < currentSeq)) {
return t; // Skip update
}Or use a distinct sentinel value (e.g., 🤖 Prompt for AI Agents |
||
| projectId | ||
| ); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
rg -nP "XSTATE_TO_PHASE" --type ts -C 10Repository: AndyMik90/Auto-Claude
Length of output: 20638
Handle
'failed'phase state in progress calculation.The
phase === 'complete' ? 100 : 0logic only recognizes'complete'as a finished state. Terminal states map mostly correctly to'complete'('done','pr_created','creating_pr','human_review'), but the'error'state maps to'failed', causing the progress bar to reset to 0% when a task errors out. Either extend the condition to include'failed'(e.g.,['complete', 'failed'].includes(phase) ? 100 : 0) or define explicit progress values for each terminal phase.🤖 Prompt for AI Agents