Coalesce completed turns across timeline byte windows - #2361
Open
ymichael wants to merge 11 commits into
Open
Conversation
ymichael
marked this pull request as draft
August 25, 2026 04:04
…e-grouping-thr_e625skpecw
ymichael
marked this pull request as ready for review
August 25, 2026 04:39
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.
What was wrong
A completed turn can exceed the timeline response byte budget and be projected from several transport windows. Completed-turn row identity was coupled to presentation segmentation: a window containing the accepted user seed or a visible intermediate response could emit
:turn:0, while a partial window for the same turn emitted the canonical:turnID. Clients therefore could not coalesce the fragments and rendered multipleWorked forrows. The first attempted fix also exposed byte-window ranges as the client's detail fetch plan, turning one expansion into a burst of range requests and leaking a storage boundary into the public contract.What changed
Worked forrow.The main timeline still deliberately keeps a finished turn whole under the event-count budget; only the byte limit can split its summary transport. Turn-detail pagination applies both limits. No host-daemon wire contract changed, so
HOST_DAEMON_PROTOCOL_VERSIONis unchanged.How you verified
The new regression reproduces the old
:turn:0plus:turnsplit across byte pages and fails before the fix. It now proves that the fragments share one canonical ID while visible responses remain visible. Unit coverage separately proves that the accepted seed is not an internal boundary, later human messages still are, and canonical identity does not widen source bounds.pnpm exec turbo run test --filter=@bb/thread-view --force: 375 tests passed.pnpm exec turbo run test --filter=@bb/server --force: 2,008 tests passed.Worked for 1h 24m 20srow. Expansion follows four opaque-cursor pages and the final UI shows oneRan 250 commandsgroup, nested progress updates, and one terminal response.Fixes: no filed issue; reproduced from a production thread timeline.