Summary
Deploy team to channel unconditionally mints a fresh Nostr keypair for every persona on every deploy, even when that persona already has a live managed instance on the same community. This inflates channel membership with same-display-name bots and breaks @mention targeting / agent coordination.
Root cause is explicit in AddTeamToChannelDialog.tsx: forceNewInstance: true is set for every persona input, which bypasses the existing reuse path in provisionChannelManagedAgent() (findReusablePersonaAgent).
Root cause (upstream main)
desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx (~line 152):
personaId: persona.id,
teamId: team.id,
// One persona can be deployed under multiple teams with different instructions.
forceNewInstance: true,
role,
forceNewInstance: true skips reuse in desktop/src/features/agents/channelAgents.ts:
if (
input.personaId &&
!input.forceNewInstance &&
context?.managedAgents &&
context.channelMemberPubkeys
) {
const reusable = findReusablePersonaAgent(/* … */);
// attach existing instance instead of createManagedAgent()
}
Meanwhile create_managed_agent in Tauri always generates new keys — there is no server-side dedup by persona_id. Frontend reuse is the only guard, and team deploy disables it.
Why the original comment does not hold
The comment claims personas need distinct instances per team because of "different instructions." In current code, persona systemPrompt is persona-scoped (not team-scoped at mint time). teamId on the record is deployment provenance / runtime instruction layering — it does not require a new keypair. Re-attaching an existing instance to another channel achieves the same outcome without spawning parallel identities.
Reproduction (single machine, single community)
- Create managed instances for personas (e.g. Welcome team: Fizz, Honey, Bumble) and deploy the team to channel A — note instance pubkeys.
- Deploy the same team (or overlapping personas) to channel B via Deploy team to channel.
buzz channels members --channel <B> shows new bot pubkeys with the same display names as step 1.
- Repeat across N channels → N duplicate pubkeys per persona name on the relay.
Also: batch deploy within one channel did not refresh reuse context after each attach in createChannelManagedAgents(), so later personas in the same batch could still mint duplicates.
Observed impact
Single ai-advantage community, single Desktop install:
- ~24 distinct bot pubkeys across channels vs 11 canonical running instances in
managed-agents.json
- Duplicate groups: Fizz (×4), SEO Agent (×4), Google Ads (×2), Process Engineer (×2), Honey/Bumble short-name variants
- Manual channel cleanup restored 11 canonical pubkeys, 0 stale bots
Expected behavior
- Deploy team to channel should reuse existing managed instances (attach + membership).
- If persona already in channel, skip mint (idempotent deploy).
- Batch deploy refreshes reuse context after each attach.
- Optional hardening: backend refuse second instance per
persona_id unless explicit force_new_instance; --pubkey on draft-update; Instance pubkey in AGENTS.md.
Proposed fix
Validated locally (uncommitted WIP):
- Remove
forceNewInstance: true from AddTeamToChannelDialog.tsx
- Add
findPersonaAgentInChannel() in provisionChannelManagedAgent()
- Refresh context in
createChannelManagedAgents() after each attach
- Hardening:
draft-update --pubkey, AGENTS.md Instance pubkey column, buzz-acp roster poll
Tests: buzz-cli 261 ✅, buzz-acp 633 ✅, desktop JS 3779 ✅, Tauri managed_agents 42 ✅
Related issues
Summary
Deploy team to channel unconditionally mints a fresh Nostr keypair for every persona on every deploy, even when that persona already has a live managed instance on the same community. This inflates channel membership with same-display-name bots and breaks
@mentiontargeting / agent coordination.Root cause is explicit in
AddTeamToChannelDialog.tsx:forceNewInstance: trueis set for every persona input, which bypasses the existing reuse path inprovisionChannelManagedAgent()(findReusablePersonaAgent).Root cause (upstream
main)desktop/src/features/agents/ui/AddTeamToChannelDialog.tsx(~line 152):forceNewInstance: trueskips reuse indesktop/src/features/agents/channelAgents.ts:Meanwhile
create_managed_agentin Tauri always generates new keys — there is no server-side dedup bypersona_id. Frontend reuse is the only guard, and team deploy disables it.Why the original comment does not hold
The comment claims personas need distinct instances per team because of "different instructions." In current code, persona
systemPromptis persona-scoped (not team-scoped at mint time).teamIdon the record is deployment provenance / runtime instruction layering — it does not require a new keypair. Re-attaching an existing instance to another channel achieves the same outcome without spawning parallel identities.Reproduction (single machine, single community)
buzz channels members --channel <B>shows new bot pubkeys with the same display names as step 1.Also: batch deploy within one channel did not refresh reuse context after each attach in
createChannelManagedAgents(), so later personas in the same batch could still mint duplicates.Observed impact
Single ai-advantage community, single Desktop install:
managed-agents.jsonExpected behavior
persona_idunless explicitforce_new_instance;--pubkeyondraft-update; Instance pubkey inAGENTS.md.Proposed fix
Validated locally (uncommitted WIP):
forceNewInstance: truefromAddTeamToChannelDialog.tsxfindPersonaAgentInChannel()inprovisionChannelManagedAgent()createChannelManagedAgents()after each attachdraft-update --pubkey,AGENTS.mdInstance pubkey column, buzz-acp roster pollTests: buzz-cli 261 ✅, buzz-acp 633 ✅, desktop JS 3779 ✅, Tauri
managed_agents42 ✅Related issues