Conversation
Collaborator
justschen
commented
Mar 12, 2026
- performance
- general rendering fix
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the chat “thinking” content rendering path, focusing on reducing layout work during streaming updates and ensuring tool invocations that should be hidden are removed at the right time.
Changes:
- Flush pending tool-removals before first expansion so removed items aren’t materialized from
lazyItems. - Batch scroll dimension updates into a single
requestAnimationFramepass and reuse a measuredcontentHeightto avoid extra layout reads. - Remove tool entries when they reach Completed/Cancelled if their presentation is
hiddenorhiddenAfterComplete.
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts:1323
- This adds new behavior to remove tools with
presentation === 'hiddenAfterComplete'once they reach Completed/Cancelled, but there’s no corresponding test coverage. Please add a unit test that simulates a tool invocation transitioning to Completed/Cancelled while the thinking part is collapsed and asserts the tool entry is removed (and not rendered later).
// Remove tools that should be hidden now or after completion.
if (toolInvocationOrMarkdown.presentation === 'hidden' || toolInvocationOrMarkdown.presentation === 'hiddenAfterComplete') {
this.pendingRemovals.push({ toolCallId: toolInvocationOrMarkdown.toolCallId, toolLabel: currentToolLabel });
this.schedulePendingRemovalsFlush();
}
You can also share your feedback on Copilot code review. Take the survey.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts
Show resolved
Hide resolved
bhavyaus
approved these changes
Mar 12, 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.