Files
buzz/desktop
Duncan 5b10fe02d9 perf(desktop): tier the observer live-event window by viewer pin
The per-agent live-event stores (`eventsByAgent`/`transcriptByAgent`/the
memoized snapshot) each kept the full MAX_OBSERVER_EVENTS window, and a
long-lived session observes many agents over time — so the accumulator grew
with the number of distinct agents seen and never shrank, one of the renderer
leaks behind the v0.5.9 lag.

Tier the window by whether a session viewer is mounted. A viewer (the two
session panels and the activity bar, via useObserverEvents/useAgentTranscript)
pins its agent with a refcount, keeping the full window so the deep scroll-back
it displays is never truncated under it. An unpinned agent — observed only by
background consumers that never display the transcript — is bounded to
UNPINNED_AGENT_EVENT_TAIL. Unpinning the last viewer immediately re-bounds the
window it accumulated, rebuilding events, transcript, and snapshot atomically
before notifying so no consumer sees a transcript referencing dropped events.

The tail is safe for every non-viewer consumer: preventSleep reads only the
newest event (always retained); the active-turns bridge processes each event
once as it arrives, with turn state living in its own store and gated by a
per-channel watermark, so a turn_started aging out of the tail cannot lose the
turn; and the profile activity feed derives a channel set that degrades to the
tail (its durable history is channel-scoped in SQLite).

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-13 17:17:26 -04:00
..
2026-08-03 21:51:17 -04:00
…

Buzz

Desktop chat shell with:

  • Tauri + React + TypeScript + Vite
  • Tailwind CSS
  • shadcn/ui-ready shared components
  • Biome (lint/format/check)
  • Feature-driven frontend structure

Scripts

  • pnpm dev - run the web frontend
  • pnpm tauri dev - run the desktop app
  • pnpm build - typecheck and build frontend
  • pnpm typecheck - TypeScript checks
  • pnpm lint - Biome lint
  • pnpm format - Biome format (write)
  • pnpm check - Biome check

Structure

  • src/shared - reusable app-wide code (ui, lib, styles)
  • src/features - feature modules (vertical slices)
  • src/app - top-level app composition