Page timeline summaries at logical boundaries - #2504
Open
ymichael wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-3375this 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_VERSIONis unchanged.How you verified
784/784threads and888,665events matched exactly, with zero missing, duplicated, reordered, or source-range-mismatched rows.250-event threshold and512 KiBbyte threshold:784/784threads matched exactly across876page 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 missing3365-3375assistant 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.