Skip to content

Commit da133d7

Browse files
committed
Pass in tool invocation
1 parent 1ec6273 commit da133d7

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

src/vs/workbench/contrib/chat/browser/chatContentParts/chatMcpServersInteractionContentPart.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export class ChatMcpServersInteractionContentPart extends Disposable implements
143143
true, // forceShowMessage
144144
undefined, // icon
145145
undefined, // confirmedReason
146+
undefined, // toolInvocation
146147
));
147148
this.domNode.appendChild(this.workingProgressPart.domNode);
148149
}

src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { IMarkdownRenderer } from '../../../../../platform/markdown/browser/mark
1313
import { IRenderedMarkdown } from '../../../../../base/browser/markdownRenderer.js';
1414
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
1515
import { localize } from '../../../../../nls.js';
16-
import { IChatProgressMessage, IChatTask, IChatTaskSerialized, ToolConfirmKind, type ConfirmedReason } from '../../common/chatService.js';
16+
import { IChatProgressMessage, IChatTask, IChatTaskSerialized, IChatToolInvocation, IChatToolInvocationSerialized, ToolConfirmKind, type ConfirmedReason } from '../../common/chatService.js';
1717
import { IChatRendererContent, isResponseVM } from '../../common/chatViewModel.js';
1818
import { ChatTreeItem } from '../chat.js';
1919
import { renderFileWidgets } from '../chatInlineAnchorWidget.js';
@@ -38,6 +38,7 @@ export class ChatProgressContentPart extends Disposable implements IChatContentP
3838
forceShowMessage: boolean | undefined,
3939
icon: ThemeIcon | undefined,
4040
confirmedReason: boolean | ConfirmedReason | undefined,
41+
private readonly toolInvocation: IChatToolInvocation | IChatToolInvocationSerialized | undefined,
4142
@IInstantiationService private readonly instantiationService: IInstantiationService,
4243
@IChatMarkdownAnchorService private readonly chatMarkdownAnchorService: IChatMarkdownAnchorService,
4344
@IConfigurationService private readonly configurationService: IConfigurationService
@@ -117,8 +118,9 @@ export class ChatProgressContentPart extends Disposable implements IChatContentP
117118
: reason.scope === 'workspace'
118119
? localize('chat.autoapprove.lmServicePerTool.workspace', 'Auto approved for this workspace')
119120
: localize('chat.autoapprove.lmServicePerTool.profile', 'Auto approved for this profile');
120-
// TODO: Pass in toolId
121-
// md += ' (' + markdownCommandLink({ title: localize('edit', 'Edit'), id: 'workbench.action.chat.editToolApproval', arguments: [this.toolInvocation.toolId] }) + ')';
121+
if (this.toolInvocation?.toolId) {
122+
md += ' (' + markdownCommandLink({ title: localize('edit', 'Edit'), id: 'workbench.action.chat.editToolApproval', arguments: [this.toolInvocation.toolId] }) + ')';
123+
}
122124
break;
123125
case ToolConfirmKind.UserAction:
124126
case ToolConfirmKind.Denied:
@@ -183,7 +185,7 @@ export class ChatWorkingProgressContentPart extends ChatProgressContentPart impl
183185
kind: 'progressMessage',
184186
content: new MarkdownString().appendText(localize('workingMessage', "Working..."))
185187
};
186-
super(progressMessage, chatContentMarkdownRenderer, context, undefined, undefined, undefined, undefined, instantiationService, chatMarkdownAnchorService, configurationService);
188+
super(progressMessage, chatContentMarkdownRenderer, context, undefined, undefined, undefined, undefined, undefined, instantiationService, chatMarkdownAnchorService, configurationService);
187189
}
188190

189191
override hasSameContent(other: IChatRendererContent, followingContent: IChatRendererContent[], element: ChatTreeItem): boolean {

src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class ChatTaskContentPart extends Disposable implements IChatContentPart
4242
this.isSettled = isSettled;
4343
const showSpinner = !isSettled && !context.element.isComplete;
4444
// TODO: Pass in confirmed reason
45-
const progressPart = this._register(instantiationService.createInstance(ChatProgressContentPart, task, chatContentMarkdownRenderer, context, showSpinner, true, undefined, undefined));
45+
const progressPart = this._register(instantiationService.createInstance(ChatProgressContentPart, task, chatContentMarkdownRenderer, context, showSpinner, true, undefined, undefined, undefined));
4646
this.domNode = progressPart.domNode;
4747
this.onDidChangeHeight = Event.None;
4848
}

src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolProgressPart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class ChatToolProgressSubPart extends BaseChatToolInvocationSubPart {
8282
this.provideScreenReaderStatus(content);
8383
}
8484

85-
return this.instantiationService.createInstance(ChatProgressContentPart, progressMessage, this.renderer, this.context, undefined, true, this.getIcon(), this.toolInvocation.isConfirmed);
85+
return this.instantiationService.createInstance(ChatProgressContentPart, progressMessage, this.renderer, this.context, undefined, true, this.getIcon(), this.toolInvocation.isConfirmed, this.toolInvocation);
8686
}
8787

8888
private getAnnouncementKey(kind: 'progress' | 'complete'): string {

src/vs/workbench/contrib/chat/browser/chatListRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
12321232
} else if (content.kind === 'multiDiffData') {
12331233
return this.renderMultiDiffData(content, templateData, context);
12341234
} else if (content.kind === 'progressMessage') {
1235-
return this.instantiationService.createInstance(ChatProgressContentPart, content, this.chatContentMarkdownRenderer, context, undefined, undefined, undefined, undefined);
1235+
return this.instantiationService.createInstance(ChatProgressContentPart, content, this.chatContentMarkdownRenderer, context, undefined, undefined, undefined, undefined, undefined);
12361236
} else if (content.kind === 'working') {
12371237
return this.instantiationService.createInstance(ChatWorkingProgressContentPart, content, this.chatContentMarkdownRenderer, context);
12381238
} else if (content.kind === 'progressTask' || content.kind === 'progressTaskSerialized') {

0 commit comments

Comments
 (0)