From 6ad98af558f342274b815116e1a9bc8411e20ee2 Mon Sep 17 00:00:00 2001 From: w3bsited3v Date: Mon, 3 Aug 2026 11:01:09 +0000 Subject: [PATCH] fix(desktop): surface eligible relay agents in @mention The @mention composer (useMentions) dropped every agent that was not in the viewer's own local managed-agents store, via isAgentIdentityInManagedList. As a result, relay agents owned by another identity (e.g. a shared, relay-hosted agent run by a separate operator) never appeared in @mention autocomplete, even though the "+" New-DM picker showed them and DMs to them worked. Keep an agent candidate when it is either locally managed OR an eligible relay agent (already present in mentionableAgentPubkeys, i.e. it passed relayAgentIsSharedWithUser). This aligns desktop @mention with the mobile client, whose buildMentionCandidates has no managed-list gate and already surfaces any relay agent that is `anyone` and shares a channel with the viewer. Signed-off-by: w3bsited3v --- desktop/src/features/messages/lib/useMentions.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/desktop/src/features/messages/lib/useMentions.ts b/desktop/src/features/messages/lib/useMentions.ts index 0c73b75339..c1fc3ccc62 100644 --- a/desktop/src/features/messages/lib/useMentions.ts +++ b/desktop/src/features/messages/lib/useMentions.ts @@ -246,7 +246,13 @@ export function useMentions( if (isArchivedDiscovery(pubkey)) { return; } - if (!isAgentIdentityInManagedList(candidate, managedAgentPubkeys)) { + // JDD fork: also keep eligible relay agents (owned by another desktop, + // e.g. the operator) so they surface in @mention, not just agents in + // this desktop's own managed list. + if ( + !isAgentIdentityInManagedList(candidate, managedAgentPubkeys) && + !mentionableAgentPubkeys.has(pubkey) + ) { return; } if (