-
Notifications
You must be signed in to change notification settings - Fork 37.5k
Fix partial markdown when it's lazy #290060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
we all agree this is a great PR thanks @roblourens 😆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Fixes collapsed/lazy “thinking” rendering so that streaming updates are reflected correctly when the user expands the thinking block.
Changes:
- Update
ChatThinkingContentPartto keep pending lazy thinking items up-to-date during streaming and avoid duplicate/stale containers on expand. - Add tests covering lazy thinking + streaming updates and a non-streaming edge case.
- Remove an unused ESLint disable directive from the test file.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/widget/chatContentParts/chatThinkingContentPart.test.ts | Adds regression tests for lazy thinking behavior (streaming and non-streaming) and removes an unused ESLint disable. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts | Updates lazy-thinking materialization and streaming update propagation to prevent stale/duplicate thinking content after expansion. |
| // Only create textContainer here if there's no pending lazy thinking item. | ||
| // If there's a lazy thinking item, it will be rendered via materializeLazyItem | ||
| // with the latest streaming content. | ||
| const hasLazyThinkingItems = this.lazyItems.some(item => item.kind === 'thinking'); | ||
| if (this.currentThinkingValue && !hasLazyThinkingItems) { |
Copilot
AI
Jan 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initContent skips creating/rendering the initial textContainer whenever any lazy thinking item exists. This can drop the constructor’s initial thinking text when another thinking section is queued via setupThinkingContainer before the part is expanded (initial content non-empty + later lazy thinking item). Consider preserving the initial thinking content (e.g. store it as a lazy thinking item when collapsed, or only skip when that initial content is already represented by a pending lazy item).
| // Only create textContainer here if there's no pending lazy thinking item. | |
| // If there's a lazy thinking item, it will be rendered via materializeLazyItem | |
| // with the latest streaming content. | |
| const hasLazyThinkingItems = this.lazyItems.some(item => item.kind === 'thinking'); | |
| if (this.currentThinkingValue && !hasLazyThinkingItems) { | |
| // Render any initial thinking content captured before expansion. | |
| if (this.currentThinkingValue) { |


Fix an issue where only the first token of thinking text would be rendered in a collapsed thinking block