chat: fix md chat response not being fully written out#278702
chat: fix md chat response not being fully written out#278702connor4312 merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where markdown chat responses containing streaming code edits were not being fully written out. The fix introduces a new isStreamingEdit property to track when code blocks in edit pills are still being streamed, and refactors the hasSameContent() method to only skip re-rendering when actively streaming.
Key Changes
- Added
IMarkdownPartCodeBlockInfointerface extendingIChatCodeBlockInfowith anisStreamingEditboolean property - Updated the
codeblocksarray type fromIChatCodeBlockInfo[]toIMarkdownPartCodeBlockInfo[] - Refactored
hasSameContent()method for better readability and to checkisStreamingEditflag before applying the streaming optimization
| readonly elementId = element.id; | ||
| readonly codemapperUri = codeblockEntry?.codemapperUri; | ||
| readonly chatSessionResource = element.sessionResource; | ||
| readonly isStreamingEdit = isCodeBlockComplete; |
There was a problem hiding this comment.
Logic error: isStreamingEdit should be set to !isCodeBlockComplete instead of isCodeBlockComplete. When a code block is incomplete (isCodeBlockComplete is false), we are still streaming it (isStreamingEdit should be true). The current logic inverts this relationship, which would cause the streaming optimization in hasSameContent() (line 423) to not work correctly during streaming.
| readonly isStreamingEdit = isCodeBlockComplete; | |
| readonly isStreamingEdit = !isCodeBlockComplete; |
b658d70 to
615a082
Compare
|
Red CI |
Refs #277214