buzz icon indicating copy to clipboard operation
buzz copied to clipboard

Desktop resolves typed @Name against all known profiles, not channel members — a removed duplicate identity still gets p-tagged, so remove-member cannot repair a mention collision

Open ciscosurplus opened this issue 3 months ago • 2 comments

Environment

  • Buzz Desktop v0.5.14, macOS (Darwin 25.4)
  • Hosted relay wss://buzz.ngnc.net
  • Same owner identity signed in on two Macs (which is how the duplicate agent identities arose — see #2648 / #6211; this issue is about the repair path, not the minting)

Summary

When several agent profiles share a display name, Buzz Desktop resolves a typed @Name in a channel composer against every profile it knows about, not against the channel's current member list. So a duplicate identity that has been removed from the channel with buzz channels remove-member is still the one that gets p-tagged. The natural fix operators reach for (remove the ghost from the channel) therefore does nothing to mentions; the only working remedy today is renaming the ghost's display name.

The CLI behaves differently and, I think, correctly: buzz messages send resolves @Name against channel members and refuses to send on an ambiguous or non-member match.

Steps to reproduce

  1. End up with two agent identities sharing display name Moneypenny (in our case one live key bebbcf8d… and one dead key 5e03b576… minted by a second Desktop whose runtime binary was missing — see #6211).
  2. Confirm both are members of channel X. Remove the dead one: buzz channels remove-member --channel <X> --pubkey 5e03b576… → succeeds; buzz channels members shows only the live key.
  3. From Desktop, in channel X, type @Moneypenny hi and send.
  4. Inspect the event: the p tag is 5e03b576… — the key that is no longer a member. The live agent is never woken.

Expected

Desktop resolves a typed mention against the channel's members (as the CLI does), and a non-member is never p-tagged. If a name is still ambiguous within the members, surface that rather than picking silently.

Actual

The removed identity is p-tagged. Removal from the channel does not change what the composer picks; only renaming the ghost's profile does.

Why it matters

Every duplicate-identity report (#2648, #5583, #6211, #5542) ends with the operator trying to clean up. Removing the ghost from channels is the obvious cleanup and it looks like it worked (roster is correct) while mentions keep going to the corpse. That silent mismatch cost us most of a day of debugging.

Related

#2648, #6211, #5583, #5542, #5264, RFC #5667

ciscosurplus avatar Aug 18 '26 17:08 ciscosurplus

Same-machine reinstall, not a second Mac.

Observed 2026-08-20 on Buzz Nest / Desktop: the owner installed and deleted Nest several times on one Mac, leaving abandoned agent nsecs. The Agents tab does not show three of each default agent. Typing @ still offers multiple Fizz / Honey / etc., including agents already deleted in that UI.

That matches the repair-path failure here: Desktop @ is not limited to the current channel members or the Agents tab. Scoping the picker to the current relay’s managed-agents.json rows (#5720) would not hide these if the local Agents list is already clean — leftover kind:0 / known profiles still resolve.

No new issue. The ask is the same as this one: resolve @Name against current channel members (as the CLI already does), not against every known profile.

vesc-vesc avatar Aug 20 '26 08:08 vesc-vesc

Variant: a human identity that was never a community member

Adding a data point that breaks the cleanup paths proposed so far. Every report above involves agents that were at some point members (or had local managed-agents.json rows). Here the duplicate is a person, and the ghost key is not a member of the community at all — so there is nothing to remove.

Environment

  • Buzz Desktop 0.5.19, macOS (Darwin 25.5)
  • Block-hosted community, NIP-43 membership enforced

What happened

  1. A teammate joined the community on mobile, which published a kind:0 profile under key A.
  2. Phone → desktop identity recovery failed for unrelated reasons, so he created a fresh desktop identity (key B) and joined with a new invite.
  3. Settings → Invites (the relay membership roster) correctly shows exactly one member for him: key B. Key A is not listed and has no access.
  4. Typing @Ker in a channel composer offers two entries with the same display name: key B, and key A labeled "not in channel".

Why the existing repair paths don't apply

  • channels remove-member — nothing to remove; key A was never a channel member.
  • Removing from the community — key A is not in the membership roster either.
  • Scoping the picker to managed-agents.json (#5720) — not an agent.

The only remedy suggested in this thread that would work is asking the teammate to rename his old profile, which requires him to still control and re-open an identity he has abandoned.

Where it comes from

buildMentionCandidates.ts merges the channel roster, agent directories, standalone personas, and global people search. That last source is gated by canSearchGlobalUsers, which in useMentions.ts is just mentionSearchQuery.length > 0 — so as soon as you type one character after @, every kind:0 profile the relay has ever indexed becomes a candidate, membership irrelevant.

Credit where due: mentionRanking.ts does sort isMember candidates first, so in the picker this is visual noise rather than mis-selection. But it is the same "resolve against all known profiles" surface this issue is about, and it feeds the typed-resolution path in the original report.

Suggested narrow fix

When a global-search candidate is a non-member whose display name collides with a candidate that is a member, drop the non-member rather than listing both. That preserves the useful case (mentioning a community member who isn't in this channel yet) while removing the duplicate-person case entirely.

Alternatively, expose the NIP-IA admin consent path in the UI. Archival already hides deleted agent identities from member lists and mention suggestions; there is no equivalent owner-facing action for a stale human identity.

jwtech-hub avatar Aug 31 '26 20:08 jwtech-hub