Skip to content

Commit d6cbaea

Browse files
AI Assistantsteipete
authored andcommitted
fix(tui): preserve streamed text during tool call transitions
Fixes #27674 The TUI was erasing already-streamed assistant text when tool calls were triggered. This happened because the finalize() method in TuiStreamAssembler was not using the protectBoundaryDrops option when updating run state. Now finalize() applies the same boundary drop protection as ingestDelta(), ensuring that streamed text before tool calls is preserved when the final payload drops earlier content blocks.
1 parent 03159f3 commit d6cbaea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tui/tui-stream-assembler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export class TuiStreamAssembler {
151151
const streamedDisplayText = state.displayText;
152152
const streamedTextBlocks = [...state.contentBlocks];
153153
const streamedSawNonTextContentBlocks = state.sawNonTextContentBlocks;
154-
this.updateRunState(state, message, showThinking);
154+
this.updateRunState(state, message, showThinking, { protectBoundaryDrops: true });
155155
const finalComposed = state.displayText;
156156
const shouldKeepStreamedText =
157157
streamedSawNonTextContentBlocks &&

0 commit comments

Comments
 (0)