Skip to content

Commit e3bb2fb

Browse files
authored
tools: fix double auto-approval message shown for terminal calls (microsoft#264369)
* tools: fix double auto-approval message shown for terminal calls * rm copilot-restored file
1 parent b8b20d7 commit e3bb2fb

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatConfirmationWidget.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818

1919
.chat-confirmation-widget + .chat-tool-approval-message {
2020
margin: -12px 6px 16px;
21-
opacity: 0.8;
22-
font-size: 12px;
21+
color: var(--vscode-descriptionForeground);
22+
font-size: var(--vscode-chat-font-size-body-s);
2323
}
2424

2525
.chat-confirmation-widget .chat-confirmation-widget-title {

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

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,18 @@ export class ChatToolInvocationPart extends Disposable implements IChatContentPa
8383
this._onDidChangeHeight.fire();
8484
}));
8585

86-
const approval = this.createApprovalMessage();
87-
if (approval) {
88-
this.domNode.appendChild(approval);
86+
// todo@connor4312/tyriar: standardize how these are displayed
87+
if (!(this.subPart instanceof ChatTerminalToolProgressPart)) {
88+
const approval = this.createApprovalMessage();
89+
if (approval) {
90+
this.domNode.appendChild(approval);
91+
}
8992
}
9093
};
9194
render();
9295
}
9396

94-
private createApprovalMessage(): HTMLElement | undefined {
97+
private get autoApproveMessageContent() {
9598
const reason = this.toolInvocation.isConfirmed;
9699
if (!reason || typeof reason === 'boolean') {
97100
return;
@@ -117,6 +120,12 @@ export class ChatToolInvocationPart extends Disposable implements IChatContentPa
117120
return;
118121
}
119122

123+
124+
return md;
125+
}
126+
127+
private createApprovalMessage(): HTMLElement | undefined {
128+
const md = this.autoApproveMessageContent;
120129
if (!md) {
121130
return undefined;
122131
}

0 commit comments

Comments
 (0)