feat: broadcast pilot agent traces via WebSocket for live status on reconnect
Agent trace logs are now stored in-memory (pilotRunStore) and broadcast through the existing /ws/crm-updates WebSocket channel. When a client reconnects, it receives a pilot.catchup with all accumulated logs so the user sees agent progress even after page reload. Three new WS event types: pilot.trace, pilot.finished, pilot.catchup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -373,6 +373,8 @@ const {
|
||||
pushPilotNote,
|
||||
refetchChatMessages,
|
||||
refetchChatConversations,
|
||||
handleRealtimePilotTrace,
|
||||
handleRealtimePilotFinished,
|
||||
destroyPilotWaveSurfer,
|
||||
togglePilotLiveLogsExpanded,
|
||||
} = pilotChat;
|
||||
@@ -678,6 +680,8 @@ const { crmRealtimeState, startCrmRealtime, stopCrmRealtime } = useCrmRealtime({
|
||||
// Refresh contacts to update sidebar preview (lastMessageText, lastAt, hasUnread)
|
||||
void refetchContacts();
|
||||
},
|
||||
onPilotTrace: (log) => handleRealtimePilotTrace(log),
|
||||
onPilotFinished: () => void handleRealtimePilotFinished(),
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user