feat(editor): Integrate Assistant mentions with composer (no-changelog) - #39314
Conversation
PR review overviewBased on ownership of the 29 changed files in this PR:
❗ Source code additions (1,043) exceed the 1,000-line limit. |
Bundle ReportChanges will increase total bundle size by 46.85kB (0.08%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: editor-ui-esmAssets Changed:
Files in
Files in
Files in
Files in
Files in
Files in
|
❌ 4 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
! PR exceeds size limit (1,043 lines added)This PR adds 1,043 lines, exceeding the 1,000-line limit (test files excluded). Large PRs are harder to review and increase the risk of bugs going unnoticed. Please consider:
If the size is genuinely justified (e.g. generated code, large migrations, test fixtures), a maintainer can override by commenting |
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Confidence score: 5/5
- The test fixtures and assertions in
packages/frontend/editor-ui/src/features/ai/assistant-at-mentions/composables/useAssistantMentionAttachments.test.tsnever exercise a truetruncatedvalue, so a regression that dropsselection.truncatedcould go undetected; add a fixture and assertion withtruncated: true.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/frontend/editor-ui/src/features/ai/assistant-at-mentions/composables/useAssistantMentionAttachments.test.ts">
<violation number="1" location="packages/frontend/editor-ui/src/features/ai/assistant-at-mentions/composables/useAssistantMentionAttachments.test.ts:83">
P3: The `truncated` flag is never actually pinned: every fixture declares `truncated: false` and every assertion hardcodes `truncated: false`, so `select()` could drop `selection.truncated` and this suite would still pass. The PR's truncation feature (oversized group selections) is only exercised in buildMentionAttachment.test.ts, not through the composable. Add a fixture with `truncated: true` (e.g., the workflow or node selection) and assert `{ status: 'added', truncated: true }` to verify propagation from `useAssistantMentionAttachments.ts:160` (`return { status: 'added', truncated: selection.truncated };`).</violation>
</file>
Shadow auto-approve: would not auto-approve because issues were found.
Fix all with cubic | Re-trigger cubic
| it('adds a structured attachment and one transient reference per mention', () => { | ||
| const { mentions, resources, onReferenceAdded, scope } = setup(); | ||
|
|
||
| expect(mentions.select(workflowSelection())).toEqual({ status: 'added', truncated: false }); |
There was a problem hiding this comment.
P3: The truncated flag is never actually pinned: every fixture declares truncated: false and every assertion hardcodes truncated: false, so select() could drop selection.truncated and this suite would still pass. The PR's truncation feature (oversized group selections) is only exercised in buildMentionAttachment.test.ts, not through the composable. Add a fixture with truncated: true (e.g., the workflow or node selection) and assert { status: 'added', truncated: true } to verify propagation from useAssistantMentionAttachments.ts:160 (return { status: 'added', truncated: selection.truncated };).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/frontend/editor-ui/src/features/ai/assistant-at-mentions/composables/useAssistantMentionAttachments.test.ts, line 83:
<comment>The `truncated` flag is never actually pinned: every fixture declares `truncated: false` and every assertion hardcodes `truncated: false`, so `select()` could drop `selection.truncated` and this suite would still pass. The PR's truncation feature (oversized group selections) is only exercised in buildMentionAttachment.test.ts, not through the composable. Add a fixture with `truncated: true` (e.g., the workflow or node selection) and assert `{ status: 'added', truncated: true }` to verify propagation from `useAssistantMentionAttachments.ts:160` (`return { status: 'added', truncated: selection.truncated };`).</comment>
<file context>
@@ -0,0 +1,142 @@
+ it('adds a structured attachment and one transient reference per mention', () => {
+ const { mentions, resources, onReferenceAdded, scope } = setup();
+
+ expect(mentions.select(workflowSelection())).toEqual({ status: 'added', truncated: false });
+ expect(mentions.select(workflowSelection())).toEqual({
+ status: 'duplicate',
</file context>
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would not auto-approve. Auto-approval blocked by 11 unresolved issues from previous reviews.
Re-trigger cubic
Summary
This PR integrates AI Assistant mentions with the composer and artifact lifecycle.
@and composer-button entry points.This is the fourth PR in the AI Assistant mentions stack. It depends on #39294.
The integration remains disabled by default. VIS-25 wires the rollout flag and completes release verification.
No screenshots are included because the rollout gate is not wired in this PR.
How to test
packages/frontend/editor-ui:pnpm test src/features/ai/assistant-at-mentions/AssistantAtMentionPicker.test.ts src/features/ai/assistant-at-mentions/composables/useAssistantAtMentions.test.ts src/features/ai/assistant-at-mentions/utils/buildMentionAttachment.test.ts src/features/ai/instanceAi/utils/buildNodesAttachment.test.ts src/features/ai/instanceAi/components/__tests__/InstanceAiInput.attachments.test.ts src/features/ai/instanceAi/components/__tests__/InstanceAiConversation.test.ts src/features/ai/instanceAi/__tests__/useResourceRegistry.test.ts src/features/ai/instanceAi/__tests__/useCanvasPreview.test.ts src/features/ai/instanceAi/__tests__/instanceAi.threadRuntime.test.tspnpm typecheckandpnpm lintfrompackages/frontend/editor-ui.packages/@n8n/api-types:pnpm test src/schemas/__tests__/instance-ai.schema.test.tspnpm typecheckandpnpm lintfrompackages/@n8n/api-types.pnpm lintfrompackages/frontend/@n8n/i18n.Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/VIS-23
Stack base: #39294
Review / Merge checklist
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)🤖 PR Summary generated by AI
This PR connects mention selection to composer text, structured context, and workflow artifact state.