block / block/buzz

Desktop @-picker hides channel-member bot-role agents when kind:10100 is absent

Open
#6,430 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

## Repro (stock desktop 0.5.17 against a v0.5.2 relay)

On a generic relay with no kind:10100 agent-directory events:

1. Admit identity A to an open channel as role `bot`. Members UI lists A as an in-channel agent.
2. Admit identity B to the same channel as role `member` (human or agent).
3. On the same desktop, keep a locally managed agent C that is **not** a member of that channel.
4. Open compose in the channel and type `@`.

Observed matrix:

| Candidate | Channel membership | Role / source | In `@` picker? |
|-----------|--------------------|---------------|----------------|
| A | member | `bot` | hidden |
| B | member | `member` | shown |
| C | non-member | locally managed agent | shown |

A remains hidden after refocus/rescroll. Mentioning A still works if the pubkey is supplied some other way (CLI / paste).

## Code path

`desktop/src/features/messages/lib/useMentions.ts` sets `isAgent` from `member.role === "bot"` (among other signals) when adding channel members.

`addCandidate` then:

1. Drops the candidate unless `isAgentIdentityInManagedList` is true (agent identities must be in the **local** managed-agent set).
2. Calls `shouldHideAgentFromMentions` (`desktop/src/features/agents/lib/agentAutocompleteEligibility.ts`).

`shouldHideAgentFromMentions` treats invocability as coming from kind:10100 (`list_relay_agents` / `relayAgentsQuery`): invocable ⇒ show; non-member and not invocable ⇒ hide; member and not in the directory ⇒ "unknown invocability ⇒ show"; member present in the directory but not invocable ⇒ explicit exclusion ⇒ hide.

With an empty directory, local agent C is invocable via the managed-agent set and is shown even as a non-member. Channel-member bot A is classified as an agent, is not locally managed, and never becomes mentionable, so it is absent from the picker even though the members modal lists it.

Related: #3277, #3809, #3776, #2603 (managed-list gate / kind:10100 directory). This report is the live membership-role matrix against a relay that publishes no 10100.

## Expected

Either:

- Honor channel membership for bot-role identities in the picker (a `bot` member should be mentionable to other channel members without being on that desktop's managed-agent list), or
- Document that deployments must publish kind:10100 with `respond_to` / channel grants for bot-role members to be mentionable, including that an empty directory is "unknown" rather than "excluded" only for candidates that pass the managed-list gate.

Do not require the mentioning user to locally own the bot.

## Impact

Desktop humans cannot invoke a shared, channel-member bot from `@` on a deployment that does not publish kind:10100. The members list and the compose picker disagree.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.