Skip to content

Page timeline summaries at logical boundaries - #2504

Open
ymichael wants to merge 2 commits into
bb/timeline-detail-paginationfrom
bb/timeline-semantic-pagination-simple
Open

Page timeline summaries at logical boundaries#2504
ymichael wants to merge 2 commits into
bb/timeline-detail-paginationfrom
bb/timeline-semantic-pagination-simple

Conversation

@ymichael

@ymichael ymichael commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Timeline event-count and byte windows were treated as if they were semantic partitions. They are not: assistant messages, completed-turn groups, system rows, and item lifecycles can span a raw cut. A row could be loaded as context and suppressed on one page, then fall before the next page's start, so no page emitted it. The affected production thread lost the assistant message at source events 3365-3375 this way.

What changed

The default top-level timeline summary now pages only at its existing user-message anchors. It does not expose event-count or byte-window cuts as page boundaries. An older page reads one following logical segment as projection-only overlap, then trims at its requested cursor; this preserves assistant/system rows whose semantic placement crosses the raw anchor. The normal stable-id page merge reconstructs the same semantic projection as an unwindowed build. The oldest page also owns the pre-first-user thread prelude.

Nested timeline consumers retain bounded event/byte windows, and completed-turn expansion retains the separately paginated turn-details resource from #2464. Idle summary pages avoid hydrating command output bodies because those outputs are collapsed; active pages keep the existing preview behavior. The grouping changes preserve visible assistant boundaries and restore source ordering for late thread-scoped system rows.

This is stacked on #2464. There is no server/daemon wire change, so HOST_DAEMON_PROTOCOL_VERSION is unchanged.

How you verified

  • Added a regression that walks logical pages and compares their exact recombination to the unpaginated projection, including a segment above both the event and byte thresholds.
  • Added coverage for assistant messages at page seams and for thread preludes before the first user anchor.
  • Copied-production audit: 784/784 threads and 888,665 events matched exactly, with zero missing, duplicated, reordered, or source-range-mismatched rows.
  • Repeated that audit at the desktop's 20-segment page size with a 250-event threshold and 512 KiB byte threshold: 784/784 threads matched exactly across 876 page responses; 47 threads crossed at least one page seam and the largest used 17 pages. The comparison included system rows and exact source ranges. The previously missing 3365-3375 assistant row is present in the affected thread.
  • pnpm exec turbo run test --filter=@bb/server --force: 2,056 passed.
  • pnpm exec turbo run test --filter=@bb/thread-view --force: 372 passed.
  • pnpm exec turbo run test --filter=@bb/db --force: 410 passed.
  • pnpm exec turbo run typecheck --filter=@bb/server --filter=@bb/thread-view --filter=@bb/db: passed.

AGENT GENERATED

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.

1 participant