Desktop: shared relay agents owned by other members are un-mentionable and un-addable (managed-list gate precedes directory eligibility)
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
## Problem
The desktop drops any agent-flagged identity that is not in the **local** managed-agents list before the relay-directory eligibility logic ever runs:
- `useMentions.ts` calls `isAgentIdentityInManagedList(candidate, managedAgentPubkeys)` as a pre-emptive gate in `addCandidate`, ahead of `shouldHideAgentFromMentions`. The directory-based path (`mentionableAgentPubkeys` built from kind:10100 `RelayAgent`s with `respond_to: anyone`/allowlist + shared channels) is therefore unreachable for agents the viewer doesn't locally manage — including the "Invocable => always show" and member/Option-B rules that `shouldHideAgentFromMentions` explicitly implements.
- `MembersSidebar.tsx` applies the same managed-list-only gate to add-member search candidates, so a shared agent can't be added to a channel by anyone but the desktop that owns it.
Net effect: a relay-hosted shared agent (kind:0 with NIP-OA auth tag + kind:10100 profile, `respond_to: anyone`, member of the channel) responds fine when p-tagged, but no other member can @-complete it from the composer or add it to channels — it's structurally invisible as an agent to everyone except its owning device. (Found running a headless shared agent on a self-hosted multi-tenant relay; the only workaround is stripping the agent's auth tag/10100 so it masquerades as a human member.)
## Expected
`shouldHideAgentFromMentions` is already the correct, complete policy (invocable → show; non-member non-invocable → hide; member + directory-excluded → hide; member + unknown → show). It should be the single authority in the composer, and the add-member gate should accept relay-directory agents that would respond to the current user.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Contributor guide
Assessment
This issue has not been assessed yet.