From 8e040f264978b8935ad122ec905764afdf49327b Mon Sep 17 00:00:00 2001 From: Albert Alises Date: Wed, 14 Jan 2026 08:48:51 +0100 Subject: [PATCH] feat(editor): Add user_message_id to AI assistant feedback telemetry (#24279) --- .../editor-ui/src/features/ai/assistant/builder.store.ts | 1 + .../ai/assistant/components/Agent/AskAssistantBuild.test.ts | 4 ++++ .../ai/assistant/components/Agent/AskAssistantBuild.vue | 1 + 3 files changed, 6 insertions(+) diff --git a/packages/frontend/editor-ui/src/features/ai/assistant/builder.store.ts b/packages/frontend/editor-ui/src/features/ai/assistant/builder.store.ts index 64f622f1b36..7fc4842a371 100644 --- a/packages/frontend/editor-ui/src/features/ai/assistant/builder.store.ts +++ b/packages/frontend/editor-ui/src/features/ai/assistant/builder.store.ts @@ -813,6 +813,7 @@ export const useBuilderStore = defineStore(STORES.BUILDER, () => { hasNoCreditsRemaining, hasMessages: computed(() => hasMessages.value), workflowTodos, + lastUserMessageId, // Methods abortStreaming, diff --git a/packages/frontend/editor-ui/src/features/ai/assistant/components/Agent/AskAssistantBuild.test.ts b/packages/frontend/editor-ui/src/features/ai/assistant/components/Agent/AskAssistantBuild.test.ts index 99eb1651e7c..5882618ac78 100644 --- a/packages/frontend/editor-ui/src/features/ai/assistant/components/Agent/AskAssistantBuild.test.ts +++ b/packages/frontend/editor-ui/src/features/ai/assistant/components/Agent/AskAssistantBuild.test.ts @@ -468,9 +468,12 @@ describe('AskAssistantBuild', () => { const workflowJson = '{"nodes": [], "connections": {}}'; describe('when workflow-updated message exists', () => { + const testUserMessageId = 'test-user-message-id'; + beforeEach(() => { // Use $patch to ensure reactivity builderStore.$patch({ + lastUserMessageId: testUserMessageId, chatMessages: [ { id: faker.string.uuid(), @@ -554,6 +557,7 @@ describe('AskAssistantBuild', () => { expect.objectContaining({ feedback: feedbackText, workflow_id: 'abc123', + user_message_id: testUserMessageId, }), ); }); diff --git a/packages/frontend/editor-ui/src/features/ai/assistant/components/Agent/AskAssistantBuild.vue b/packages/frontend/editor-ui/src/features/ai/assistant/components/Agent/AskAssistantBuild.vue index b4f8ff58b37..08ec6483dfa 100644 --- a/packages/frontend/editor-ui/src/features/ai/assistant/components/Agent/AskAssistantBuild.vue +++ b/packages/frontend/editor-ui/src/features/ai/assistant/components/Agent/AskAssistantBuild.vue @@ -168,6 +168,7 @@ function onFeedback(feedback: RatingFeedback) { feedback: feedback.feedback, workflow_id: workflowsStore.workflowId, session_id: builderStore.trackingSessionId, + user_message_id: builderStore.lastUserMessageId, }); } }