Agents page lists every local managed agent, not just agents active in the currently viewed community
Problem
The sidebar Agents page (desktop/src/features/agents/ui/AgentsView.tsx) lists every managed agent that has ever been created on the local Desktop install, with no filtering by which community/relay is currently active.
Confirmed in the data path, not just the UI:
useManagedAgentsQuery(desktop/src/features/agents/hooks.ts:354-374) callslistManagedAgents()with zero parameters — no relay/community argument anywhere in the query.useManagedAgentActions(desktop/src/features/agents/ui/useManagedAgentActions.ts) only filters the resulting list by running/idle status, never by community.
So switching the active community tab never changes what the Agents page shows — it always renders the full local inventory of agent records on that machine, whether or not any given agent is actually a member of (or was ever deployed to) the community currently being viewed.
Impact
For anyone running multiple communities from one Desktop install, this is confusing and looks like a data-hygiene bug even when it isn't one: agents that were only ever added to Community A also show up while viewing Community B, with no indication they aren't actually present there. In our case this made a fully-cleaned-up community (verified via direct relay DB query — zero membership/channel rows) look like cleanup had failed, because the Agents page kept showing agents that were never actually members of that community at all.
Suggested fix
ManagedAgentRecord already carries a relay_url field (desktop/src-tauri/src/managed_agents/types.rs). The Agents page could filter (or group) its list by whether relay_url matches the currently active community, rather than showing the unfiltered global inventory.
Open design question that needs a decision before implementing: it's not yet clear whether relay_url reliably reflects every community an agent is actually present in, or just the community it was originally created in — bootstrapManagedAgentRuntimePairs (desktop/src/features/agents/managedAgentRuntimeHooks.ts) suggests agents can get a "lazy pair" reconciled into other communities after creation, which may mean an agent can be legitimately active in a community other than the one in relay_url. Filtering naively on relay_url alone could hide an agent from a community it's actually deployed to. Would like maintainer input on the intended semantics here before a PR lands, rather than guessing.
Environment
Found and verified 2026-08-20 while auditing Buzz Desktop v0.5.16 against a self-hosted relay (multi-community setup: two separate communities on one Desktop install).
Adding a user report supporting this issue: the community-facing Agents list shows agents that do not belong to the selected community. Their icons may be absent there even though they display in the community where those agents belong.
Requested behavior: show only agents currently authorized for the selected community, consistently across communities. Agents authorized in multiple communities should appear in each authorized community. If a global agent library is useful, expose it as a separate, clearly labeled management view rather than mixing it into the community roster.
Please ensure switching communities and membership removal update the visible roster without retaining entries from the previous community. This is a request about roster presentation, not a claim that access restrictions have been bypassed.
Source follow-up for this issue: the published desktop-v0.5.26 release still passes agents.managedAgents and personas.libraryPersonas directly into UnifiedAgentsSection in AgentsView.tsx. The current main-branch file also retains this data path.
Please avoid fixing this by comparing only the original relay_url, or by blindly intersecting with explicit kind:13534 membership rows. Multi-community agents and NIP-OA owner-delegated admission need to remain visible where they are actually admitted; the relay explicitly supports delegated admission through BUZZ_ALLOW_NIP_OA_AUTH. An explicit membership roster is not universally a complete effective-admission roster.
Suggested acceptance cases for the client fix:
- Community view contains only agents admitted to that selected community; the owner-global library remains accessible through a clearly separate management view.
- The same agent can appear in multiple authorized communities.
- Switching communities/accounts, membership removal and delegated-access revocation cannot retain stale cards.
- Loading, unavailable admission and failed refresh are distinguished from an authoritative empty roster.
- Profile images and online presence are resolved in the selected community, without using either as proof of admission.
The shared membership hook currently uses the unscoped ["relayMembers"] query key, so cache/async-result scoping should be addressed as part of this change. Is there an implementation PR planned or an existing supported community-roster setting? This follow-up concerns public source behavior and does not assert an access-control bypass.