Skip to content

fix(desktop): only offer channel-roster agents in the @-mention picker - #9527

Open
Pleximus29 wants to merge 2 commits into
block:mainfrom
Pleximus29:fix/desktop-mention-channel-roster
Open

Pleximus29 wants to merge 2 commits into
block:mainfrom
Pleximus29:fix/desktop-mention-channel-roster

Conversation

@Pleximus29

Copy link
Copy Markdown

Summary

In a channel, the 0.X desktop @-mention picker offered agents that are not on that channel's roster. One cause is that locally managed agents always pass getMentionableAgentPubkeys. This change filters the final candidate list in buildMentionCandidates to !isAgent || isMember when mentionChannelId is set. People, and the case with no channel, are unchanged. This is a 0.X bug fix, not feature work.

Related issue

Fixes #9521

Testing

  • New test, "in a channel, agents outside its roster are not offered", covering managed and relay agents. On main without the fix it fails: expected [Ada, Xenophon], got [Ada, Argus, Fizz, Scout, Xenophon].
  • With the fix, the desktop unit suite (src/**/*.test.mjs, scripts/*.test.mjs) passes 6,972 of 6,972.
  • We have run the same change in our own desktop build since 2026-10-31.
  • No screenshots: this is a logic-only filter, and the behaviour is fully covered by the unit test.
  • Not run locally: Biome, because of a local config/version mismatch, and the jsdom tests.

🤖 Generated with Claude Code

In a channel, agents that are not members of it were offered as mention
candidates. Filter agent candidates to roster members when a channel is
set; people and the no-channel case are unchanged.

Fixes block#9521

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yanik <yanik@brunetenterprises.com>
@Pleximus29
Pleximus29 requested a review from a team as a code owner November 15, 2026 06:56
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 69742376a9b1b15da62295f54a053913540722c1...23846d5e48003967d6d54107e343222a35d3ea06.
A new review must complete for this exact range. When manual authorization
is required, a user with write access must comment exactly
@buzz-security-review 23846d5e48003967d6d54107e343222a35d3ea06 to authorize a new review.
Any previous review applies only to its recorded range.

@joahg joahg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 The filter looks right to me: in a channel, agents need isMember to be offered, while people and the no-channel case (DM/new message) are unchanged, and the two new tests cover both sides.

Leaving this as a comment rather than an approval because it changes what users see in the desktop mention picker. It needs a sign-off from a design or core-team reviewer, especially on whether hiding non-member agents is the intended behavior. Today, mentioning an agent that isn't in the channel is one way people discover they need to add it, so it may be worth confirming whether that path should get a hint instead of disappearing entirely.

Nit: the new comment ("In a channel, only agents on its roster are offered.") restates the condition right below it and could be dropped.

Review nit on block#9527.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Yanik <yanik@brunetenterprises.com>
@Pleximus29

Copy link
Copy Markdown
Author

Thanks. I've dropped the comment in 23846d5.

On hiding versus a hint: for us, hiding is the intended behaviour. Some agents in our community are private to one person. A "not in this channel, add it?" hint would point other members at an agent they aren't meant to know about, while hiding reveals nothing. The no-channel case (DM / New Message) is unchanged.

To be clear, hiding in the picker isn't a privacy boundary. We checked with a fresh member in no channels. It could still list every agent's kind:0 profile and every kind:30177 record (owner and allowlist) straight from the relay. I filed that separately as #9528. This PR only makes the channel picker match what the channel can actually reach.

@joahg joahg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Thanks. The only change since my last pass is dropping the comment, and the filter logic is the same.

Your reasoning on hiding makes sense: a hint would leak the existence of private agents, and it's good that #9528 tracks the relay-side listing, since the picker isn't a privacy boundary. I don't have further findings. I'm still leaving this as a comment rather than an approval, because desktop mention-picker behavior needs sign-off from a design or core-team reviewer.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: @-mention picker offers agents that are not in the current channel

2 participants