block / block/buzz

Desktop @-mention autocomplete only shows locally managed agents

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

Description

## Purpose

Teams need to `@mention` shared / org-level agents from their own Buzz Desktop — for example a research agent owned by someone else but configured with `respond_to: allowlist` or `anyone` and present in a shared channel.

Today that is impossible through the UI. Non-owners only see agents managed by **their own Desktop install**. `respond_to` settings cannot fix it.

## Blocker

In Desktop mention autocomplete, agent candidates are filtered by `isAgentIdentityInManagedList` **before** the `respond_to` / shared-channel eligibility logic runs.

`managedAgentPubkeys` comes from `listManagedAgents` (local Tauri command for this install). Any channel member with `role: "bot"` whose pubkey is not in that local set is dropped.

So the allowlist / anyone eligibility code in `relayAgentIsSharedWithUser` / `shouldHideAgentFromMentions` is unreachable for cross-owner agents.

## Actual vs expected

| | |
|---|---|
| **Actual** | `@` list shows only agents this Desktop manages. Cross-owner channel bots never appear. |
| **Expected** | Agents that are channel members and that the viewer is allowed to invoke (`respond_to: anyone` + shared channel, or `respond_to: allowlist` including the viewer) appear in `@` autocomplete. |

## Repro

1. User A owns agent X; agent X is a member of a shared channel; `respond_to` is `allowlist` (includes User B) or `anyone`.
2. User B opens that channel on their own Desktop (does not manage agent X).
3. User B types `@` in the composer.

**Result:** Agent X is missing. User B only sees agents their install manages.

**Note:** Explicit CLI `--mention ` still delivers (relay accepts it). This is a Desktop autocomplete UI gate, not a relay delivery failure.

## Code

- `desktop/src/features/messages/lib/useMentions.ts` (~244–262) — `addCandidate` order: managed-list filter before eligibility hide
- `desktop/src/features/agents/lib/agentAutocompleteEligibility.ts` (`isAgentIdentityInManagedList`, `relayAgentIsSharedWithUser`)
- `desktop/src/features/agents/hooks.ts` (`useManagedAgentsQuery` → local `listManagedAgents`)

## Out of scope for this issue

Whether the harness author gate wakes the agent after a successful mention. That is a separate path. This issue is only: **non-owners cannot select the agent in Desktop `@` autocomplete.**

Contributor guide

Open the contributing guide

Research direction

Start in desktop/src/features/messages/lib/useMentions.ts around addCandidate and trace the eligibility helpers in desktop/src/features/agents/lib/agentAutocompleteEligibility.ts, including the managed-agent query in hooks.ts. Reproduce with a non-owner viewing a shared-channel agent, then verify that allowed anyone/allowlist agents appear while disallowed agents and existing local filtering behavior remain correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.