From 05543dc7a3c8054e70e00e2d59c0cb7afdf87cc3 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 18 Nov 2025 06:32:51 +0100 Subject: [PATCH] agent sessions - offer setup for OOTB for continue actions (#277991) --- .../browser/actions/chatContinueInAction.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.ts b/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.ts index 10f8f5e0078..5e83a16c45f 100644 --- a/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.ts +++ b/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.ts @@ -35,6 +35,8 @@ import { ChatAgentLocation } from '../../common/constants.js'; import { IChatWidgetService } from '../chat.js'; import { MarkdownString } from '../../../../../base/common/htmlContent.js'; import { ThemeIcon } from '../../../../../base/common/themables.js'; +import { ICommandService } from '../../../../../platform/commands/common/commands.js'; +import { CHAT_SETUP_ACTION_ID } from './chatActions.js'; export class ContinueChatInSessionAction extends Action2 { @@ -96,6 +98,12 @@ export class ChatContinueInSessionActionItem extends ActionWidgetDropdownActionV actions.push(this.toAction(cloudContrib, instantiationService)); } + // Offer actions to enter setup if we have no contributions + if (actions.length === 0) { + actions.push(this.toSetupAction(AgentSessionProviders.Background, instantiationService)); + actions.push(this.toSetupAction(AgentSessionProviders.Cloud, instantiationService)); + } + return actions; } }; @@ -115,6 +123,25 @@ export class ChatContinueInSessionActionItem extends ActionWidgetDropdownActionV }; } + private static toSetupAction(type: string, instantiationService: IInstantiationService): IActionWidgetDropdownAction { + const label = type === AgentSessionProviders.Cloud ? + localize('continueInCloud', "Continue in Cloud") : + localize('continueInBackground', "Continue in Background"); + + return { + id: type, + enabled: true, + icon: type === AgentSessionProviders.Cloud ? Codicon.cloud : Codicon.collection, + class: undefined, + tooltip: label, + label, + run: () => instantiationService.invokeFunction(accessor => { + const commandService = accessor.get(ICommandService); + return commandService.executeCommand(CHAT_SETUP_ACTION_ID); + }) + }; + } + protected override renderLabel(element: HTMLElement): IDisposable | null { const icon = this.contextKeyService.contextMatchesRules(ChatContextKeys.remoteJobCreating) ? Codicon.sync : Codicon.indent; element.classList.add(...ThemeIcon.asClassNameArray(icon));