Skip to content

Reduce conversation outline refetches during streaming - #2027

Merged
ymichael merged 1 commit into
mainfrom
bb/fix-chatty-conversation-outline-thr_yumqpifzcy
Aug 20, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/fix-chatty-conversation-outline-thr_yumqpifzcy

Conversation

@ymichael

@ymichael ymichael commented Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

What was wrong

The active thread timeline and the full-history conversation outline shared the same realtime invalidation group, so every events-appended streaming batch sent another /conversation-outline request. The server cache hardening now on main from #2025 avoids rebuilding for outline-irrelevant events, but the client still performs redundant HTTP reads at streaming cadence, and assistant text deltas can still invalidate the full projection. The outline does not need sub-second route refreshes because the incremental timeline already carries the live conversation rows.

What changed

  • Split realtime timeline-window invalidation from conversation-outline invalidation.
  • Refresh the full outline at the terminal turn boundary instead of for every streaming delta; unknown lifecycle notifications still invalidate it conservatively, and history rewrites retain the existing full invalidation path.
  • Overlay live timeline conversation rows onto the cached full outline so current user and assistant messages remain fresh while a turn streams.
  • Reconciled the server cache documentation with the outline-aware cache added by Fix long-thread database and event-loop stalls #2025 and the new client refresh policy.
  • Added regressions proving streaming deltas do not refetch the outline, turn completion does, and live timeline labels replace or extend a cached outline.

This implements the client-side pacing direction from #1972 using a turn boundary plus live-row overlay instead of a timed debounce. It does not change the API contract or the server/daemon wire format, so HOST_DAEMON_PROTOCOL_VERSION is unchanged.

How you verified

The new realtime invalidation test fails before the change because an assistant delta refetches the active outline query. The TOC merge test also fails before the change because a loaded outline always wins over newer timeline rows.

After rebasing onto origin/main at 0b2723a:

  • pnpm exec turbo run test --filter=@bb/app -- src/hooks/cache-owners/cache-owner-registry.test.ts src/hooks/realtime-cache-effects.test.ts src/components/thread/toc/ThreadTableOfContents.test.tsx — 80 tests passed
  • pnpm exec turbo run typecheck --filter=@bb/app — passed
  • git diff --check origin/main...HEAD — passed

Fixes #1972

AGENT GENERATED: by GPT-5

@ymichael
ymichael force-pushed the bb/fix-chatty-conversation-outline-thr_yumqpifzcy branch from 5d3bd00 to 08671cb Compare August 20, 2026 08:49
@ymichael
ymichael force-pushed the bb/fix-chatty-conversation-outline-thr_yumqpifzcy branch from 08671cb to 9f39e38 Compare August 20, 2026 08:51
@ymichael
ymichael merged commit c7c6642 into main Aug 20, 2026
13 checks passed
@ymichael
ymichael deleted the bb/fix-chatty-conversation-outline-thr_yumqpifzcy branch August 20, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

conversation-outline rebuilds the full history with every tool output on each appended event; 1.3 s event-loop stalls on a 24 MB thread

1 participant