Skip to content

chat: fix md chat response not being fully written out#278702

Merged
connor4312 merged 3 commits intomainfrom
connor4312/277214
Nov 21, 2025
Merged

chat: fix md chat response not being fully written out#278702
connor4312 merged 3 commits intomainfrom
connor4312/277214

Conversation

@connor4312
Copy link
Member

Refs #277214

Copilot AI review requested due to automatic review settings November 21, 2025 04:16
@connor4312 connor4312 enabled auto-merge (squash) November 21, 2025 04:16
@connor4312 connor4312 self-assigned this Nov 21, 2025
@vs-code-engineering vs-code-engineering bot added this to the November 2025 milestone Nov 21, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 IMarkdownPartCodeBlockInfo interface extending IChatCodeBlockInfo with an isStreamingEdit boolean property
  • Updated the codeblocks array type from IChatCodeBlockInfo[] to IMarkdownPartCodeBlockInfo[]
  • Refactored hasSameContent() method for better readability and to check isStreamingEdit flag before applying the streaming optimization

readonly elementId = element.id;
readonly codemapperUri = codeblockEntry?.codemapperUri;
readonly chatSessionResource = element.sessionResource;
readonly isStreamingEdit = isCodeBlockComplete;
Copy link

Copilot AI Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
readonly isStreamingEdit = isCodeBlockComplete;
readonly isStreamingEdit = !isCodeBlockComplete;

Copilot uses AI. Check for mistakes.
roblourens
roblourens previously approved these changes Nov 21, 2025
@bpasero
Copy link
Member

bpasero commented Nov 21, 2025

Red CI

lramos15
lramos15 previously approved these changes Nov 21, 2025
@connor4312 connor4312 dismissed stale reviews from lramos15 and roblourens via 171e2a7 November 21, 2025 17:26
roblourens
roblourens previously approved these changes Nov 21, 2025
rebornix
rebornix previously approved these changes Nov 21, 2025
@connor4312 connor4312 dismissed stale reviews from rebornix and roblourens via 1c536ed November 21, 2025 17:52
@connor4312 connor4312 merged commit 5222f59 into main Nov 21, 2025
28 checks passed
@connor4312 connor4312 deleted the connor4312/277214 branch November 21, 2025 18:12
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants