fix: merge streamed model history turns - #2566
Open
he-yufeng wants to merge 1 commit into
Open
Conversation
he-yufeng
force-pushed
the
fix/merge-stream-model-history
branch
from
June 12, 2026 11:48
cb4b2b7 to
77160fd
Compare
Contributor
Author
|
Rebased this branch onto current Validation:
|
he-yufeng
force-pushed
the
fix/merge-stream-model-history
branch
2 times, most recently
from
June 12, 2026 16:23
f8cd04f to
bee08cd
Compare
he-yufeng
force-pushed
the
fix/merge-stream-model-history
branch
from
August 17, 2026 00:18
bee08cd to
86463ee
Compare
Contributor
Author
|
Rebased onto current main. Upstream's fe6118e reworked AFC in chat streams and deleted the two AFC history fixtures along with their tests, so this branch drops them too and keeps only the new split-output fixture and the curated-history regression test. The merge behavior is unchanged; the rebased suite passes locally (18 passed, including the new test). |
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.
Fixes #2508.
Summary
When a streaming response yields multiple valid model
Contentchunks, the chat currently keeps those chunks as consecutivemodelturns in curated history. That history is reused for later requests, so the next request can include back-to-back model turns instead of a single model turn.This change keeps comprehensive history unchanged, but normalizes curated history by merging adjacent model chunks into one model turn. That preserves the original parts while keeping request history in the expected user/model turn shape.
Tests