From 375f19b94e816982129057d78c6fa70b30a3023e Mon Sep 17 00:00:00 2001 From: Tom Ballard Date: Fri, 31 Jul 2026 12:04:20 +0100 Subject: [PATCH 1/2] fix(desktop): resolve mentions from channel members [issue:#3204] Signed-off-by: Tom Ballard --- .../src/features/messages/lib/useMentions.ts | 5 ----- desktop/tests/e2e/mentions.spec.ts | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/desktop/src/features/messages/lib/useMentions.ts b/desktop/src/features/messages/lib/useMentions.ts index 0c73b75339..f6bd877a54 100644 --- a/desktop/src/features/messages/lib/useMentions.ts +++ b/desktop/src/features/messages/lib/useMentions.ts @@ -16,7 +16,6 @@ import { coalesceAutocompleteCandidatesByKey, getMentionableAgentPubkeys, getSharedChannelIds, - isAgentIdentityInManagedList, shouldHideAgentFromMentions, } from "@/features/agents/lib/agentAutocompleteEligibility"; import { @@ -246,9 +245,6 @@ export function useMentions( if (isArchivedDiscovery(pubkey)) { return; } - if (!isAgentIdentityInManagedList(candidate, managedAgentPubkeys)) { - return; - } if ( shouldHideAgentFromMentions({ isAgent: candidate.isAgent === true, @@ -420,7 +416,6 @@ export function useMentions( managedAgentNamesByPubkey, managedAgentPersonaIds, managedAgentPersonaIdsByPubkey, - managedAgentPubkeys, managedAgentsQuery.data, memberPubkeys, members, diff --git a/desktop/tests/e2e/mentions.spec.ts b/desktop/tests/e2e/mentions.spec.ts index 512eb3d800..8d10ad1cb5 100644 --- a/desktop/tests/e2e/mentions.spec.ts +++ b/desktop/tests/e2e/mentions.spec.ts @@ -241,6 +241,23 @@ test("@ trigger prioritizes channel members before runnable personas and other m expect(fizzIndex).toBeLessThan(charlieIndex); }); +test("@ includes channel-member agents that are not locally managed", async ({ + page, +}) => { + await installMockBridge(page); + await page.goto("/"); + await page.getByTestId("channel-general").click(); + await expect(page.getByTestId("chat-title")).toHaveText("general"); + + const input = page.getByTestId("message-input"); + await input.fill("@mi"); + + const row = autocomplete(page).locator("button", { hasText: "mira" }); + await expect(row).toBeVisible(); + await expect(row.getByTestId("mention-agent-icon")).toBeVisible(); + await expect(row.getByText("not in channel")).toHaveCount(0); +}); + test("thread autocomplete keeps multiple long names readable in a narrow panel", async ({ page, }) => { From ba6650acaa0138603c1c0718e90db2ee387f7fab Mon Sep 17 00:00:00 2001 From: Tom Ballard Date: Fri, 31 Jul 2026 14:36:34 +0100 Subject: [PATCH 2/2] test(desktop): cover mention allowlist visibility [issue:#3204] Verify channel-member agents stay hidden from autocomplete when the viewer is outside their respond_to allowlist. Signed-off-by: Tom Ballard --- desktop/tests/e2e/mentions.spec.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/desktop/tests/e2e/mentions.spec.ts b/desktop/tests/e2e/mentions.spec.ts index 8d10ad1cb5..6f50bad08d 100644 --- a/desktop/tests/e2e/mentions.spec.ts +++ b/desktop/tests/e2e/mentions.spec.ts @@ -258,6 +258,33 @@ test("@ includes channel-member agents that are not locally managed", async ({ await expect(row.getByText("not in channel")).toHaveCount(0); }); +test("@ hides channel-member agents when the viewer is outside their allowlist", async ({ + page, +}) => { + await installMockBridge(page, { + relayAgents: [ + { + pubkey: PROFILE_ONLY_AGENT_PUBKEY, + name: "mira", + channelNames: ["general"], + respondTo: "allowlist", + respondToAllowlist: [TEST_IDENTITIES.alice.pubkey], + }, + ], + }); + await page.goto("/"); + await page.getByTestId("channel-general").click(); + await expect(page.getByTestId("chat-title")).toHaveText("general"); + + const input = page.getByTestId("message-input"); + await input.fill("@mi"); + + await expect(autocomplete(page)).not.toBeVisible(); + await expect( + page.getByTestId(`mention-suggestion-${PROFILE_ONLY_AGENT_PUBKEY}`), + ).toHaveCount(0); +}); + test("thread autocomplete keeps multiple long names readable in a narrow panel", async ({ page, }) => {