Fix final answer detection in markdown rendering logic#293746
Merged
justschen merged 2 commits intomicrosoft:mainfrom Feb 15, 2026
Merged
Fix final answer detection in markdown rendering logic#293746justschen merged 2 commits intomicrosoft:mainfrom
justschen merged 2 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes chat markdown rendering so the “final answer” portion is identified as the content after the last pinned thinking/tool-related part, instead of assuming it’s always the last content element. This addresses cases where the final message (e.g., a trailing code block) was incorrectly routed into the last thinking part and not rendered as expected.
Changes:
- Update
ChatListItemRenderer.renderMarkdownto compute a “final answer” region based on the last thinking/tool invocation content index. - Gate “final answer” detection to the final (non-progressive) render pass for completed responses.
src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts
Outdated
Show resolved
Hide resolved
justschen
approved these changes
Feb 9, 2026
Collaborator
justschen
left a comment
There was a problem hiding this comment.
thanks, i saw this issue once or twice!
justschen
requested changes
Feb 9, 2026
src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts
Outdated
Show resolved
Hide resolved
DonJayamanne
previously approved these changes
Feb 9, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
roblourens
approved these changes
Feb 15, 2026
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.
This PR updates
renderMarkdownto identify the final answer by finding content after the last pinned thinking or tool part, replacing the previous "last element" check. Fix #293700Without this PR, codeblocks in the final response will be rendered in the
lastThinkingpart.cc: @justschen