Files
buzz/desktop/src/shared
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 e8dc2ebf0f feat(desktop): surface managed-agent leadership and cooperative steal
Phase 3a emits a `leadership_status` observer frame per window-instance
every 5s and handles a `claim_leadership` control frame. The desktop had
no consumer. This adds the owner-side surface: a per-agent leader badge
and a per-instance "Make leader" steal action.

The frames already land in `eventsByAgent` via the owner-wide observer
subscription, so leadership is a cached derivation rather than a new
store. `getAgentLeadership` stays a stable map lookup (required by
`useSyncExternalStore`); the `leadershipByAgent` array is rebuilt only
when a leadership frame appends. Staleness stays out of the store — the
row filters against a 5s clock so a crashed leader's badge drops within
15s without a new frame. The steal ack is non-authoritative: the UI
converges off the stream, never optimistically flipping the badge.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-06-24 17:27:15 -04:00
..
2026-06-24 12:55:25 -07:00
2026-06-10 21:07:02 +00:00