Fix final answer detection in markdown rendering logic (#293746)

* Fix final answer detection in markdown rendering logic

* Update src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Takashi Tamura
2026-02-15 15:54:34 +09:00
committed by GitHub
parent 8e56833278
commit dfd7335658

View File

@@ -2326,7 +2326,9 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
private renderMarkdown(markdown: IChatMarkdownContent, templateData: IChatListItemTemplate, context: IChatContentPartRenderContext): IChatContentPart {
const element = context.element;
const isFinalAnswerPart = isResponseVM(element) && element.isComplete && context.contentIndex === context.content.length - 1;
const isFinalRenderPass = isResponseVM(element) && element.isComplete && !element.renderData;
const lastPinnedPartIndex = isFinalRenderPass ? context.content.findLastIndex(c => c.kind === 'thinking' || c.kind === 'toolInvocation' || c.kind === 'toolInvocationSerialized') : -1;
const isFinalAnswerPart = isFinalRenderPass && context.contentIndex > lastPinnedPartIndex;
if (!this.hasCodeblockUri(markdown) || isFinalAnswerPart) {
this.finalizeCurrentThinkingPart(context, templateData);
}