Skip to content

Desktop: shared relay agents owned by other members are un-mentionable and un-addable (managed-list gate precedes directory eligibility) #2603

Description

@leesalminen

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 RelayAgents 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions