Files
buzz/desktop
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7andWill Pfleger 2ee01cb85a fix(desktop): defer pre-resolution null-session items in splitIntoSessionRuns
The first-turn wire sequence emitted by the harness is:
  turn_started(sessionId=null) → session/new(sessionId=null) → session_resolved(sessionId=X) → session/prompt(sessionId=X)

The previous splitIntoSessionRuns opened a synthetic 'unknown' run for the
leading null-session items, then opened a second run when session_resolved
arrived. This caused two bugs:

1. Leaked system prompt: the session/new metadata had no following user prompt
   in its 'unknown' run so pendingSystemPrompt was never consumed and emitted
   as a standalone 'System prompt' row. Caught by Desktop Smoke E2E (3),
   observer-feed-screenshots.spec.ts:726 (expected count 0, got 1).

2. Spurious session boundary: two runs from one session triggered
   buildTranscriptDisplayBlocks to inject a session-boundary block on a feed
   that has exactly one session — the opposite of the signal this PR adds.

Fix: buffer pre-resolution null-session items and prepend them to the first
run that has a non-null sessionId. Only if the entire stream has no resolved
session do they form a fallback 'unknown' run. Mid-stream null-session items
(after resolution) continue to attribute to the current run as before.

Added two regression tests:
- firstTurnSequence_noStandaloneSystemPrompt: asserts zero standalone
  session/new blocks, zero session-boundary blocks, system prompt present
  inside the turn block (prompt bundle).
- genuineSecondSession_boundaryPreserved: asserts the deferral fix does not
  collapse two genuinely distinct sessions — boundary is still injected.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-07-08 15:02:44 -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