fix thinking spinning and breaking when it shouldn't (#281428)

* fix thinking spinning and breaking when it shouldn't

* fix working spinner
This commit is contained in:
Justin Chen
2025-12-05 17:21:38 +08:00
committed by GitHub
parent 6e0d3977de
commit bbf2868a31
@@ -289,14 +289,6 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
this.viewModel = viewModel;
this._announcedToolProgressKeys.clear();
for (const templateData of this.templateDataByRequestId.values()) {
if (templateData.renderedParts) {
const lastThinking = this.getLastThinkingPart(templateData.renderedParts);
if (lastThinking?.getIsActive()) {
lastThinking.markAsInactive();
}
}
}
}
getCodeBlockInfoForEditor(uri: URI): IChatCodeBlockInfo | undefined {
@@ -773,19 +765,17 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
// Show if no content, only "used references", ends with a complete tool call, or ends with complete text edits and there is no incomplete tool call (edits are still being applied some time after they are all generated)
const lastPart = findLast(partsToRender, part => part.kind !== 'markdownContent' || part.content.value.trim().length > 0);
const thinkingStyle = this.configService.getValue<ThinkingDisplayMode>('chat.agent.thinkingStyle');
const collapsedToolsMode = this.configService.getValue<CollapsedToolsDisplayMode>('chat.agent.thinking.collapsedTools');
if (collapsedToolsMode !== CollapsedToolsDisplayMode.Off) {
const hasActiveThinking = !!this.getLastThinkingPart(templateData.renderedParts);
if (hasActiveThinking) {
return lastPart?.kind !== 'thinking' && lastPart?.kind !== 'toolInvocation' && lastPart?.kind !== 'prepareToolInvocation' && lastPart?.kind !== 'textEditGroup' && lastPart?.kind !== 'notebookEditGroup';
if (collapsedToolsMode === CollapsedToolsDisplayMode.Always || (collapsedToolsMode === CollapsedToolsDisplayMode.WithThinking && this.getLastThinkingPart(templateData.renderedParts))) {
if (!lastPart || lastPart.kind === 'thinking' || lastPart.kind === 'toolInvocation' || lastPart.kind === 'prepareToolInvocation' || lastPart.kind === 'textEditGroup' || lastPart.kind === 'notebookEditGroup') {
return false;
}
}
if (
!lastPart ||
lastPart.kind === 'references' || (lastPart.kind === 'thinking' && thinkingStyle !== ThinkingDisplayMode.FixedScrolling) ||
lastPart.kind === 'references' ||
((lastPart.kind === 'toolInvocation' || lastPart.kind === 'toolInvocationSerialized') && (IChatToolInvocation.isComplete(lastPart) || lastPart.presentation === 'hidden')) ||
((lastPart.kind === 'textEditGroup' || lastPart.kind === 'notebookEditGroup') && lastPart.done && !partsToRender.some(part => part.kind === 'toolInvocation' && !IChatToolInvocation.isComplete(part))) ||
(lastPart.kind === 'progressTask' && lastPart.deferred.isSettled) ||