buzz icon indicating copy to clipboard operation
buzz copied to clipboard

feat(desktop): show each agent's role/description in the @-mention selector

Open prabhatgmp opened this issue 4 months ago • 2 comments

Problem

The @-mention selector lists agents by display name + avatar only — there's nothing to tell you what each agent is for. In a workspace with several agents (especially a themed set that share a visual style), they're near-indistinguishable at the point of use. You have to already know each agent's role from memory, or scroll back to whenever they introduced themselves.

Concrete case: a hive with three bee agents — Fizz (builder), Honey (writer), Bumble (researcher) — renders as three near-identical rows in the selector. A user hovering the composer can't tell who to call for "debug this" vs "summarize this thread" vs "go research X." Their words: "we have 3 bee agents, but it's so hard to tell which one does what. Whom should I call for when I need to do something?"

mention selector — three agents, no role labels

Proposed UX

  • In the @-mention autocomplete row, show a one-line role/description under (or beside) each agent's display name — same pattern the slash-command autocomplete in #2528 proposes for command descriptions.
  • Source the line from the agent's public kind:0 profile about field. Fall back to nothing (name only, as today) when about is empty, so this degrades gracefully.
  • Keep it to one line, truncated — the selector is a quick picker, not a profile card.

Data-source note

  • Agents don't reliably publish an about today (observed kind:0 profiles carry only display_name + picture). Surfacing the field is only useful if agent creation seeds a short role string into about. Worth pairing this with a default: when an owner drafts an agent, derive a one-line about from its purpose/system-prompt.
  • Related: #2534 — kind:0 profile republish drops every field outside a 5-key allowlist. If about isn't in that allowlist, it'll get silently stripped on republish and this feature will show blanks. That allowlist needs about preserved for this to hold.

Non-goals

  • Full agent profile cards / hover popovers (a bigger surface; this is just the inline picker line).
  • Slash-command discovery — that's #2528.

Workaround today

Agents can self-describe in chat, but that's not discoverable at mention time. A cheat-sheet has to be re-asked for.


Reported by a Buzz user (Glomopay hive) via their in-workspace researcher agent. Screenshot is the user's own composer.

prabhatgmp avatar Jul 24 '26 10:07 prabhatgmp

I'd like to take this one.

Plan, after tracing the data path on current main:

  • The desktop's batch profile summaries (get_users_batch → nostr_convert::users_batch_from_events) already parse kind:0 content but drop about, and the TS layer omits it as well (RawUserProfileSummary = Omit<RawProfile, "pubkey" | "about"> in tauriProfiles.ts). Step one is carrying about through that summary path — Tauri conversion + UserProfileSummary / UserSearchResult types. No relay changes needed.
  • useMentions already batch-fetches owner profiles to build the "managed by …" label (ownerProfilesQuery); agent candidate pubkeys get the same treatment so about resolves even for agents who haven't authored anything in the loaded timeline. The per-pubkey delta cache backing useUsersBatchQuery keeps this cheap.
  • MentionAutocomplete already renders a second meta line for agents (bot icon + "agent" + "managed by …"). When about is non-empty it replaces the literal "agent" text as a single truncated line, keeping the bot icon and the managed-by suffix; empty about renders exactly today's row, so this degrades gracefully as described in the issue.
  • Unit tests for the kind:0 about parse and the suggestion mapping, plus screenshots.

Out of scope per the issue's non-goals: profile cards/popovers and #2528. Also not touching the #2534 allowlist here — though once about survives republish, this UI lights up with no further changes.

webdevtodayjason avatar Jul 24 '26 11:07 webdevtodayjason

Opened #2706 for this — kind-0 about carried through the desktop profile-summary path and rendered as a one-line role under agent rows in the selector, with the graceful name-only fallback when about is empty. Screenshots on the PR.

webdevtodayjason avatar Jul 24 '26 11:07 webdevtodayjason