Skip to content

Desktop: DM sidebar keeps a remote ACP agent green after it goes offline, until relaunch (members list is correct) #7946

Open

Description

@jasonLadd

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:48 builds the DM rows' status from usePresenceQuery(dmParticipantPubkeys), a query cached separately from the members list's.
  • desktop/src/features/presence/hooks.ts polls 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)

  1. Have an open DM with a remote buzz-acp agent, and the agent listed in a channel's members.
  2. Stop the agent's process gracefully (SIGTERM). It publishes presence offline.
  3. Look at the sidebar: the members list shows the agent offline; the DM list still shows it green.
  4. Keep Desktop open. The DM row stays green.
  5. 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 at 0cc63fe3 (image built from main, 2026-09-23); agent harness buzz-acp built from 0cc63fe3
  • 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 presence for the agent returns nothing (offline); two other agents return online. 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 offline again 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions