fix(desktop): surface eligible relay agents in @mention - #4517
Conversation
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 <dev@jdd.agency>
|
Heads-up from a parallel investigation on #5363, in case it's useful here. The We opened #5483 with a data-layer fix: merge Not a claim that this PR is wrong — the two layers are compatible — just that the eligibility change alone may not be reproducibly verifiable against relay-published agents. Full analysis in #5363. |
Summary
Desktop @mention autocomplete drops shared relay agents — agents owned by
another identity, e.g. a relay-hosted agent run by a separate operator and
shared with a team.
useMentionsfilters candidates throughisAgentIdentityInManagedList, which only keeps agents present in theviewer's own local
managed-agentsstore. So an eligible relay agent isnever offered in
@-autocomplete, even though the+New-DM picker lists itand DMs to it work.
The mobile client's
buildMentionCandidates(
mobile/lib/features/channels/mentions/mention_candidates.dart) has nosuch gate — it has no local agent store — and already surfaces any relay
agent that is
anyoneand shares a channel with the viewer. This changebrings desktop in line: keep an agent candidate when it is either locally
managed or already eligible via
mentionableAgentPubkeys(i.e. it passedrelayAgentIsSharedWithUser). Eligibility semantics are unchanged — the fixonly stops the managed-list filter from dropping already-eligible relay
agents.
Related issue
Fixes #4128. Related: #3971, #3125, #3776.
Testing
Verified against a self-hosted relay: a shared, relay-hosted agent
(
respond_to=anyone, joined to a channel the viewer is a member of, with akind:10100 directory entry) now appears in desktop
@-mention autocomplete,matching the mobile client. Previously it was reachable only via the
+New-DM picker.
pass
isAgentIdentityInManagedList).mentionableAgentPubkeysset, so no new eligibilitypath is introduced.
Happy to add a focused test if you'd like — the current
useMentions.test.mjsonly covers thehasMentionstring helpers, so thecandidate-assembly path isn't unit-tested today; let me know your preference
for structuring one.