Conversation
Finalizing active text items dropped the item registration but kept the accumulated text buffer, so the next chunk of the same stream key created a second item seeded with everything already painted (issue 2778). Release the buffer together with the registration; the item remains the source of truth for its own content, so a genuine late chunk still continues it.
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.
Problem
Fixes #2778 — in a long turn the same assistant text was painted several times even though the model emitted it once (reported on the remote-control / multi-device session path).
Root cause
completeActiveTextItemsinsrc/web-ui/src/flow_chat/services/flow-chat-manager/TextChunkModule.tsfinalizes the active text items at a model-round boundary. It cleared the item registrations but left each stream key's accumulated entries in the session content buffer. The next chunk for the same stream key then found no reusable item and opened a new text item seeded with the whole accumulated buffer, so the first segment showed up again inside the second item.Fix
completeActiveTextItemsnow releases the accumulated buffer entries together with the item registrations it finalizes. The item itself stays the source of truth for its own content, so a genuine late chunk still continues the existing item through the existing reuse path.Changed files:
src/web-ui/src/flow_chat/services/flow-chat-manager/TextChunkModule.ts(+14/-3)src/web-ui/src/flow_chat/services/flow-chat-manager/TextChunkModule.test.ts(+56/-1)Validation
vitest run flow_chat/services/flow-chat-manager/TextChunkModule.test.ts flow_chat/services/flow-chat-manager/EventHandlerModule.test.tstsc --noEmit(web-ui)1 failed | 7 passed— the second text item re-contained the whole first segmentThe regression test replays the round-boundary sequence: paint a segment, finalize active text items, then apply the next chunk of the same stream key.
Notes / residual risk