Skip to content

Commit 68cb518

Browse files
authored
don't show autopilot handoff when policy is disabled (#306151)
1 parent 2e20252 commit 68cb518

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ export class ChatSuggestNextWidget extends Disposable {
100100
}
101101

102102
const isAutopilotEnabled = this.configurationService.getValue<boolean>(ChatConfiguration.AutopilotEnabled) !== false;
103-
const firstAutoSendHandoff = isAutopilotEnabled ? handoffs.find(h => h.send) : undefined;
103+
const isAutopilotPolicyRestricted = this.configurationService.inspect<boolean>(ChatConfiguration.GlobalAutoApprove).policyValue === false;
104+
const firstAutoSendHandoff = isAutopilotEnabled && !isAutopilotPolicyRestricted ? handoffs.find(h => h.send) : undefined;
104105

105106
for (const handoff of handoffs) {
106107
const promptButton = this.createPromptButton(handoff);

0 commit comments

Comments
 (0)