Skip to content

Self-improving AI Employees for everyone

fix(agent_progress): defensive status='executing' so iteration badge actually shows

trohitg15b8d9df1671
diff --git a/client/src/contexts/WebSocketContext.tsx b/client/src/contexts/WebSocketContext.tsx
index 26ad8eb7..726956f9 100644
--- a/client/src/contexts/WebSocketContext.tsx
+++ b/client/src/contexts/WebSocketContext.tsx
@@ -863,8 +863,19 @@ export const WebSocketProvider: React.FC<{ children: React.ReactNode }> = ({ chi
const previous =
store.allStatuses[progressWorkflowId]?.[targetNodeId] ||
({} as NodeStatus);
+ // Defensive: an agent_progress event implies the agent IS
+ // mid-loop. Set status='executing' even if no prior
+ // node_status broadcast arrived first (race or edge case
+ // where the agent finishes in a single step). Without this,
+ // AIAgentNode's `isExecuting && iteration != null` gate
+ // hides the badge entirely.
+ const carriedStatus =
+ previous.status === 'success' || previous.status === 'error'
+ ? previous.status
+ : 'executing';
store.setStatus(progressWorkflowId, targetNodeId, {
...previous,
+ status: carriedStatus,
workflow_id: progressWorkflowId,
data: {
...(previous.data || {}),