Skip to content

Commit 5051f30

Browse files
authored
cloud button quickpick (microsoft#259674)
1 parent 51df05e commit 5051f30

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { ContextKeyExpr, IContextKeyService } from '../../../../../platform/cont
2020
import { IDialogService } from '../../../../../platform/dialogs/common/dialogs.js';
2121
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
2222
import { KeybindingWeight } from '../../../../../platform/keybinding/common/keybindingsRegistry.js';
23+
import { IQuickInputService } from '../../../../../platform/quickinput/common/quickInput.js';
2324
import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js';
2425
import { IRemoteCodingAgentsService } from '../../../remoteCodingAgents/common/remoteCodingAgentsService.js';
2526
import { IChatAgentHistoryEntry, IChatAgentService } from '../../common/chatAgents.js';
@@ -598,11 +599,31 @@ export class CreateRemoteAgentJobAction extends Action2 {
598599
);
599600

600601
const agents = remoteCodingAgent.getAvailableAgents();
601-
const agent = agents[0]; // TODO: We just pick the first one for now
602-
if (!agent) {
602+
if (agents.length === 0) {
603+
chatModel.completeResponse(addedRequest);
603604
return;
604605
}
605606

607+
let agent = agents[0];
608+
if (agents.length > 1) {
609+
const quickInputService = accessor.get(IQuickInputService);
610+
const pick = await quickInputService.pick(
611+
agents.map(a => ({
612+
label: a.displayName,
613+
description: a.description,
614+
agent: a,
615+
})),
616+
{
617+
title: localize('selectCodingAgent', "Select Coding Agent"),
618+
}
619+
);
620+
if (!pick) {
621+
chatModel.completeResponse(addedRequest);
622+
return;
623+
}
624+
agent = pick.agent;
625+
}
626+
606627
let summary: string | undefined;
607628
let followup: string | undefined;
608629
if (defaultAgent && chatRequests.length > 0) {

0 commit comments

Comments
 (0)