Repository navigation
Description
Describe the bug
A remote agent (a buzz-acp harness on another host, not a Desktop-managed agent) went offline, and the Direct Messages list in the sidebar kept showing it online (green) while the channel members list correctly showed it offline at the same time. The DM list only corrected itself after Buzz Desktop was quit and relaunched.
The relay was right the whole time. The agent's buzz-acp logged presence set to offline on shutdown, and a buzz users presence --pubkeys <agent> query returned no presence for it while the DM row was still green.
This looks related to, but distinct from, #5938 and #4730. Those are about managed remote agents whose profile panel derives liveness from backend_agent_id. Here the stale view is the DM sidebar, whose status does come from real presence:
desktop/src/features/sidebar/useDmSidebarMetadata.ts:48builds the DM rows' status fromusePresenceQuery(dmParticipantPubkeys), a query cached separately from the members list's.desktop/src/features/presence/hooks.tspolls that query every 60 s, but only while the app is focused (useFocusedRefetchInterval,desktop/src/shared/lib/useDocumentVisible.ts:105), with a 5-minute focus stale time. Its own comment says the poll is the backstop that "catches REST-only writers (ACP agents)". So for an ACP agent, the DM list sees an offline transition only when that poll runs.- The members list shows the change because opening it creates or refetches its own presence query.
I don't know the root cause. Possibilities include the DM query's poll not firing (focus state), a websocket presence event updating the DM query's cache with a later REST offline never overwriting it, or the query key not being refetched after a reconnect. See the timeline below: there was a relay restart in the window.
Steps to reproduce (what happened; not yet reduced to a minimal case)
- Have an open DM with a remote
buzz-acpagent, and the agent listed in a channel's members. - Stop the agent's process gracefully (SIGTERM). It publishes presence
offline. - Look at the sidebar: the members list shows the agent offline; the DM list still shows it green.
- Keep Desktop open. The DM row stays green.
- Quit and relaunch Buzz Desktop: the DM row now shows offline.
Expected behavior
The DM list shows the same presence as the members list, at the latest within one presence poll (60 s) while the app is focused, without a relaunch.
Version and platform
- Buzz version: Desktop 0.5.25 (
desktop-v0.5.25); self-hosted relay at0cc63fe3(image built frommain, 2026-09-23); agent harnessbuzz-acpbuilt from0cc63fe3 - OS: macOS (Apple Silicon)
Logs / additional context
Timeline, UTC, 2026-09-28:
- 16:11:12: agent stopped. Its log:
shutting down→presence set to offline→buzz-acp stopped. - 16:13:32:
buzz users presencefor the agent returns nothing (offline); two other agents returnonline. Members list: offline. DM list: green. - ~16:15–16:17: unrelated power event rebooted the relay host; Desktop lost and regained its relay connection.
- 16:28:09–16:29:03: the agent's host rebooted and the agent came online briefly, then was stopped again, publishing
offlineagain at 16:29:03. - ~16:40 or later: DM list still green; relaunching Desktop fixed it.
So the stale window spans a relay reconnect and a brief online/offline flap, which may matter. What's certain is the end state: the relay said offline, the members list said offline, and the DM list said online until relaunch.
Activity