Renaming an agent in one community renames a different agent (different keypair) in another community
Summary
Two managed agents that have different keypairs and live in different communities share a single persona record. Renaming one of them renames the other. The agent identity is scoped per community and per install; the definition that names it is install-global and keyed by a value that is byte-identical everywhere.
Observed with two agents created from the built-in Welcome Team, on two separate machines and two separate relays.
Not a data-exposure issue
Stating this up front so severity is not misjudged: KIND_PERSONA (30175) is a member of SHARED_GATED_KINDS (crates/buzz-core/src/kind.rs:215), so persona events are author-only unless they carry exactly ["shared","true"], enforced at every relay read chokepoint. System prompts do not become readable across communities, no identity signs on the wrong relay, and no message crosses. What crosses is configuration — display name, and by the same path prompt/model/runtime.
Reproduction
- Install the built-in Welcome Team.
- Create an agent from one of its personas in Community A. It gets its own keypair.
- Create an agent from the same persona in Community B (separate relay; a second machine makes it more visible). It gets a different keypair.
- Rename the agent in Community A via the Agents view.
- The agent in Community B is renamed too.
Root cause — three factors converging
1. The definition store is install-global.
agents/personas.json, agents/managed-agents.json, and agents/teams.json are one file per install, with no per-community partition — while agents/retention/ is correctly partitioned into one database per community. The isolation boundary was drawn at events but not at definitions.
2. Editing an agent edits the shared persona.
The Agents view routes the edit through updatePersonaAndPublish (desktop/src/features/agents/ui/usePersonaActions.ts:195) — the shared definition, not the per-pubkey managed-agent record.
3. The persona d-tag is the bare team slug.
persona_d_tag (desktop/src-tauri/src/managed_agents/persona_events.rs:65) prefers source_team_persona_slug and only falls back to the record's UUID id. Every persona sourced from a built-in team therefore keys on a slug that is identical across every community and every install.
apply_inbound_persona (desktop/src-tauri/src/commands/personas/inbound.rs:342) then overwrites display_name, avatar_url, system_prompt, runtime, model, provider, respond_to, and parallelism on whatever record matches that d-tag.
rename in Community A
→ patches the one global persona keyed by the team slug
→ agent in Community B (different keypair, different relay) is renamed
The managed-agent path is correctly scoped by contrast — its d-tag is the agent pubkey (inbound.rs:365), so those events never collide.
Relay sync is not required to trigger this
The shared local file alone is sufficient: both agents resolve the same persona record on the same install. The kind:30175 sync (inbound.rs:22 — "so Device B inherits Device A's edits") extends the same collision across machines, but is not the origin.
This also means the per-community retention scoping does not mitigate it, even though that scoping is otherwise correct.
Suggested fix
Real fix: scope the persona d-tag. persona_d_tag should mix in the community (and arguably the install) rather than returning the bare team slug, so two agents instantiated from the same built-in persona in different communities occupy different coordinates.
Cheap mitigation: make the managed agent's own name authoritative for presentation, so a persona behaves as a template applied at creation rather than a live binding.
Worth deciding explicitly which of these is intended, since "built-in personas stay in sync across my devices" is plausibly a feature for the single-community case — but it should not reach across communities.
Not verified
I traced the Agents view to the persona update path but did not step through which exact form field the rename submits. The empirical behaviour (rename crosses communities) is confirmed; the precise UI field binding is inferred.
Line references are against 6c16354.
Independent reproduction, on a setup that narrows the repro surface described above.
The original report was observed across two separate machines and two separate relays. I hit the same behaviour on a single machine, single Desktop install, two hosted communities (one I created, one I was invited to) — so neither a second install nor a second machine is required. One Desktop process, one local agent store, two communities is enough.
Environment: Desktop 0.5.8 (dev build from source, commit 119a84897), relay 0.2.1 hosted on *.communities.buzz.xyz, macOS 26.5.2 arm64.
What I saw:
- Naming an agent per-community does not take. Both communities retained the same name across all variants of the agent, including agents holding different keypairs.
- Renaming after a restart sometimes takes effect — it isn't a consistent no-op, which points at a race or a cache/read-path ordering issue on top of the install-global persona record, rather than a purely static key collision.
That last point may be the most useful detail to chase: if the rename were only ever losing to a byte-identical global key, it should fail deterministically. Intermittent success after restart suggests whichever record is read first at startup wins, and the persona write is landing somewhere that a later read doesn't consistently prefer.
Adjacent, from the same session: Desktop also spawned duplicate buzz-acp daemons for the same (agent, community) pair after the second community was added — two live daemons, each with its own relay connection and pool, both matching the same #p mention filter. Filed separately as #5759 since it's a process-lifecycle bug rather than a persona-record one, but both surfaced from the same "add a second community" flow and may share a trigger.
Cross-linking two other open issues that I believe share this root cause, because each is currently readable as an isolated symptom.
The pattern: a persona definition (kind:30175) is a single record that several distinct agent identities resolve to, and inbound sync applies it unconditionally. All three reports below are that same overwrite. Only the axis it leaks across differs, and the axis is decided purely by which field the user happened to edit.
| Issue | Leaks across | Fields observed |
|---|---|---|
| #5218 | devices | model, provider, system_prompt, runtime, respond_to, parallelism |
| #5601 (this) | communities | display_name |
| #5705 | instance vs. template, incl. the identity it signs as | display_name |
Mechanism
Verified against main @ a96af895:
managed_agents/persona_events.rs:69—persona_d_tagpreferssource_team_persona_slugand only falls back to the record UUID. Builtin-team personas therefore key on a bare slug that is byte-identical across every machine and every community.commands/personas/inbound.rs:376—local.display_name = inbound.display_name, with no notion of whether the local value was inherited or explicitly set. #5218 documents the same unconditional assignment for the rest of the definition.features/agents/ui/usePersonaActions.ts:195— the Agents view routes edits throughupdatePersonaAndPublish, i.e. the shared definition rather than the per-pubkey agent record. So "rename this agent" is in fact "rewrite the template every agent shares".
Worth noting the managed-agent path (kind:30177) is correctly scoped — its d-tag is the agent pubkey, so it cannot collide. The scoping discipline exists in the codebase; the persona path just does not inherit it.
Why triage them together
Each issue has a plausible narrow fix that leaves the other two standing:
- Scope the d-tag by community → fixes #5601, leaves #5218 (cross-device is the same key by design there).
- Suppress inbound
display_name→ fixes #5601 and part of #5705, leaves every other field in #5218. - Add a rename guard → this is roughly what #5705 reports as having made their state unrecoverable.
The design comment on #5705 — durable name authority, i.e. an instance value is either inherited from template or an explicit override, with a "Reset to template" action and a preview of affected agents before a template rename — is the shape that generalizes. Extended from display_name to the whole definition, it resolves #5218 too, because "device B's model was set explicitly" becomes representable state instead of something inferred from string equality.
One decision that should be made deliberately
Cross-device inheritance appears to be intended — inbound.rs:20-22 says so outright: "the frontend's live subscription invokes this per event for our own authored coordinate so Device B inherits Device A's edits."
Cross-community inheritance (this issue) almost certainly is not.
Right now both run through one code path keyed by one slug, so there is no way to keep the wanted behaviour and drop the unwanted one without separating them first. That seems like the actual decision to make, ahead of any individual fix.
Related
#5553 (allow hiding or disabling the builtin personas / Welcome Team) is not the same bug, but the builtin team is precisely where the slug-keyed d-tag collision is guaranteed by construction rather than incidental — so those users are the population exposed to all three issues at once, and are also the ones with no supported way to opt out.
recreated...
environment: buzz desktop v0.5.23, windows 11 pro 22631
summary: the desktop app shows an agent's public key in two different encodings depending on where you look. the agents settings panel shows raw hex. the @-mention picker shows a truncated npub. both are truncated. neither view offers the other encoding, and neither offers a copy affordance. when several agents share a display name, the public key is the only thing that tells them apart, so i manually changed the name (from Fizz to Fizz_123) of each and found that the naming changed ALL agents with the name Fizz to Fizz_123. when i went to change another one that did NOT change them across the board after that.
hex and npub are the same 32 bytes under two encodings. there is no shared prefix. d00d2275... and npub16qxj... look like unrelated keys me, and yet they were the same agent.
steps to reproduce
- have two or more agents whose display names are the same or similar.
- open settings, agents, and read the public key on an agent card. it is hex.
- open a channel composer and type @ to open the mention picker. the rows are labeled with a truncated npub.
- try to decide which picker row corresponds to which agent card.
expected one encoding, or both encodings, in both places. at minimum, every place a key is shown truncated should offer click to copy for the full value.
actual agents panel: hex, truncated. mention picker: npub, truncated. no copy affordance in either. no way to convert one to the other inside the app or explicitely tell the app to make them exactly the same!