Skip to content

fix: prevent rendering thinking part for final answer in chat list#288178

Merged
justschen merged 1 commit intomicrosoft:mainfrom
tamuratak:fix_final_codeblockuri_rendering
Jan 25, 2026
Merged

fix: prevent rendering thinking part for final answer in chat list#288178
justschen merged 1 commit intomicrosoft:mainfrom
tamuratak:fix_final_codeblockuri_rendering

Conversation

@tamuratak
Copy link
Contributor

fix: prevent rendering thinking part for final answer in chat list. Fix #287897

cc: @justschen

Copilot AI review requested due to automatic review settings January 15, 2026 21:57
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


return thinkingPart;
}

Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

The removal of !isFinalAnswerPart check here could be confusing without context. Consider adding a comment explaining that this code is now inside a block that already excludes final answer parts (line 1827), making the additional check redundant. This would improve code maintainability and make the logic clearer for future readers.

Suggested change
// Note: this block only runs for non-final answer parts (see condition at line 1827),
// so we do not need to repeat an explicit !isFinalAnswerPart check here.

Copilot uses AI. Check for mistakes.
lastThinking.appendItem(markdownPart.domNode, markdownPart.codeblocksPartId, markdown, templateData.value);
}
} else if (!this.shouldPinPart(markdown, context.element) && !isFinalAnswerPart) {
} else if (!this.shouldPinPart(markdown, context.element)) {
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

Similar to the previous comment, the removal of !isFinalAnswerPart could benefit from a comment. Since this entire block (lines 1827-1856) is now gated on !isFinalAnswerPart, readers should understand that the removed checks are redundant rather than accidentally omitted.

Suggested change
} else if (!this.shouldPinPart(markdown, context.element)) {
} else if (!this.shouldPinPart(markdown, context.element)) {
// The enclosing block is only executed for non-final answer parts (!isFinalAnswerPart),
// so we intentionally do not repeat that check here.

Copilot uses AI. Check for mistakes.
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 22, 2026
@justschen justschen enabled auto-merge (squash) January 25, 2026 04:43
@justschen justschen merged commit 81b5475 into microsoft:main Jan 25, 2026
25 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat output response collapses or is cutoff

3 participants