fix(desktop): allow bot channel members in mention picker from any device - #4653
Open
albertleecs322 wants to merge 2 commits into
Open
fix(desktop): allow bot channel members in mention picker from any device#4653albertleecs322 wants to merge 2 commits into
albertleecs322 wants to merge 2 commits into
Conversation
…vice isAgentIdentityInManagedList was filtering out bot-role channel members that aren't in the local managedAgentPubkeys set. On non-host devices this set is empty, so every agent in the channel was silently dropped before shouldHideAgentFromMentions could run — which already correctly gates on invocability (respondTo=anyone + shared channel). Fix: pass through candidates where isMember === true so shouldHideAgentFromMentions handles the invocability decision, not a blanket local-ownership check. Signed-off-by: Albert Lee <albertleecs322@gmail.com>
Signed-off-by: Albert Lee <albertleecs322@gmail.com>
| with: | ||
| node-version: 24.14.1 | ||
|
|
||
| - uses: pnpm/action-setup@v4 |
| with: | ||
| node-version: 24.14.1 | ||
|
|
||
| - uses: pnpm/action-setup@v4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Agents added to a channel as members (role:
bot) cannot be @mentioned fromdevices that don't own/manage those agents locally.
Root cause:
isAgentIdentityInManagedListfilters out any candidate whereisAgent === truebut the pubkey isn't inmanagedAgentPubkeys. On theagent-owning device that set is populated; on every other device it's empty, so
ALL channel bots are silently dropped from the mention picker — even when the
agent is set to
respondTo: "anyone".The downstream
shouldHideAgentFromMentionsalready handles invocabilitycorrectly (member agents with unknown invocability are shown; those explicitly
excluded by the relay directory are hidden), but it never runs because the
candidate is rejected first.
Fix
Add
candidate.isMember === trueas a pass-through condition inisAgentIdentityInManagedList. Bot channel members are allowed to reachshouldHideAgentFromMentions, which gates on actual invocability rather thanlocal ownership.
Test
Added an assertion for the new case in the existing
isAgentIdentityInManagedListtest: a non-locally-managed agent that IS achannel member returns
true.All 18 existing tests in
agentAutocompleteEligibility.test.mjscontinue topass.
Behaviour change
respondTo: anyoneSigned-off-by: Albert Lee albertleecs322@gmail.com