diff --git a/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.ts b/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.ts index b19c0ce3e3c..6add7ab1ea1 100644 --- a/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.ts +++ b/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.ts @@ -41,7 +41,7 @@ export class ChatToolProgressSubPart extends BaseChatToolInvocationSubPart { private createProgressPart(): HTMLElement { const isComplete = IChatToolInvocation.isComplete(this.toolInvocation); - if (isComplete && this.toolIsConfirmed && this.toolInvocation.pastTenseMessage) { + if (isComplete && this.toolIsConfirmed && (this.toolInvocation.pastTenseMessage || this.toolInvocation.invocationMessage)) { const key = this.getAnnouncementKey('complete'); const completionContent = this.toolInvocation.pastTenseMessage ?? this.toolInvocation.invocationMessage; // Don't render anything if there's no meaningful content @@ -49,7 +49,7 @@ export class ChatToolProgressSubPart extends BaseChatToolInvocationSubPart { return document.createElement('div'); } const shouldAnnounce = this.toolInvocation.kind === 'toolInvocation' && this.hasMeaningfulContent(completionContent) ? this.computeShouldAnnounce(key) : false; - const part = this.renderProgressContent(completionContent, shouldAnnounce); + const part = this.renderProgressContent(completionContent!, shouldAnnounce); this._register(part); return part.domNode; } else { @@ -65,8 +65,8 @@ export class ChatToolProgressSubPart extends BaseChatToolInvocationSubPart { if (state.type === IChatToolInvocation.StateKind.Cancelled && state.reasonMessage) { progressContent = state.reasonMessage; } else if (state.type === IChatToolInvocation.StateKind.Executing) { - const progress = state.progress.read(reader); - progressContent = progress?.message ?? this.toolInvocation.invocationMessage; + const progressMessage = state.progress.read(reader)?.message; + progressContent = this.hasMeaningfulContent(progressMessage) ? progressMessage : this.toolInvocation.invocationMessage; } else { progressContent = this.toolInvocation.invocationMessage; } @@ -80,7 +80,7 @@ export class ChatToolProgressSubPart extends BaseChatToolInvocationSubPart { return; } const shouldAnnounce = this.toolInvocation.kind === 'toolInvocation' && this.hasMeaningfulContent(progressContent) ? this.computeShouldAnnounce(key) : false; - const part = reader.store.add(this.renderProgressContent(progressContent, shouldAnnounce)); + const part = reader.store.add(this.renderProgressContent(progressContent!, shouldAnnounce)); dom.reset(container, part.domNode); })); return container; diff --git a/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts b/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts index f850a5fc63a..8dab80c925a 100644 --- a/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts +++ b/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.ts @@ -1237,6 +1237,21 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer { + if (templateData.currentElement !== originalElement) { + return; + } + this.doUpdateWorkingProgressForPendingConfirmations(templateData); + }); + } + + private doUpdateWorkingProgressForPendingConfirmations(templateData: IChatListItemTemplate): void { const element = templateData.currentElement; if (!isResponseVM(element)) { return;