From d7952ef09298c48d0ee0d5a6e269961d9ff1beaf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 24 Aug 2026 14:37:59 +0000 Subject: [PATCH 1/4] Initial plan From 74e8d34cb4f555be90ac9d577e867d572646025b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 24 Aug 2026 14:42:14 +0000 Subject: [PATCH 2/4] Route custom agent configuration to customizations Co-authored-by: aeschli <6461412+aeschli@users.noreply.github.com> --- .../browser/promptSyntax/chatModeActions.ts | 16 ++------- .../promptSyntax/chatModeActions.test.ts | 35 +++++++++++++++++++ 2 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 src/vs/workbench/contrib/chat/test/browser/promptSyntax/chatModeActions.test.ts diff --git a/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.ts b/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.ts index ea210ea05f2241..0eb695959029c8 100644 --- a/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.ts +++ b/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.ts @@ -7,26 +7,16 @@ import { CHAT_CATEGORY, CHAT_CONFIG_MENU_ID } from '../actions/chatActions.js'; import { Codicon } from '../../../../../base/common/codicons.js'; import { ChatContextKeys } from '../../common/actions/chatContextKeys.js'; import { localize, localize2 } from '../../../../../nls.js'; -import { PromptFilePickers } from './pickers/promptFilePickers.js'; import { ServicesAccessor } from '../../../../../editor/browser/editorExtensions.js'; import { Action2, MenuId, registerAction2 } from '../../../../../platform/actions/common/actions.js'; -import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js'; -import { PromptsType } from '../../common/promptSyntax/promptTypes.js'; +import { ICommandService } from '../../../../../platform/commands/common/commands.js'; import { ChatViewId } from '../chat.js'; import { ContextKeyExpr } from '../../../../../platform/contextkey/common/contextkey.js'; -import { IOpenerService } from '../../../../../platform/opener/common/opener.js'; +import { AICustomizationManagementCommands, AICustomizationManagementSection } from '../aiCustomization/aiCustomizationManagement.js'; abstract class ConfigAgentActionImpl extends Action2 { public override async run(accessor: ServicesAccessor): Promise { - const instaService = accessor.get(IInstantiationService); - const openerService = accessor.get(IOpenerService); - const pickers = instaService.createInstance(PromptFilePickers); - const placeholder = localize('configure.agent.prompts.placeholder', "Select the custom agents to open and configure visibility in the agent picker"); - - const result = await pickers.selectPromptFile({ placeholder, type: PromptsType.agent, optionEdit: false, optionVisibility: true }); - if (result !== undefined) { - await openerService.open(result.promptFile); - } + await accessor.get(ICommandService).executeCommand(AICustomizationManagementCommands.OpenEditor, AICustomizationManagementSection.Agents); } } diff --git a/src/vs/workbench/contrib/chat/test/browser/promptSyntax/chatModeActions.test.ts b/src/vs/workbench/contrib/chat/test/browser/promptSyntax/chatModeActions.test.ts new file mode 100644 index 00000000000000..2144dd58293683 --- /dev/null +++ b/src/vs/workbench/contrib/chat/test/browser/promptSyntax/chatModeActions.test.ts @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import assert from 'assert'; +import { mock } from '../../../../../../base/test/common/mock.js'; +import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../../base/test/common/utils.js'; +import { ICommandService, CommandsRegistry } from '../../../../../../platform/commands/common/commands.js'; +import { TestInstantiationService } from '../../../../../../platform/instantiation/test/common/instantiationServiceMock.js'; +import { AICustomizationManagementCommands, AICustomizationManagementSection } from '../../../browser/aiCustomization/aiCustomizationManagement.js'; +import { registerAgentActions } from '../../../browser/promptSyntax/chatModeActions.js'; + +registerAgentActions(); + +suite('Chat mode actions', () => { + const store = ensureNoDisposablesAreLeakedInTestSuite(); + + test('Configure Custom Agents opens the Agents customizations section', async () => { + const instantiationService = store.add(new TestInstantiationService()); + const calls: unknown[][] = []; + instantiationService.stub(ICommandService, new class extends mock() { + override async executeCommand(commandId: string, ...args: unknown[]): Promise { + calls.push([commandId, ...args]); + return undefined; + } + }()); + + const command = CommandsRegistry.getCommand('workbench.action.chat.picker.customagents'); + assert.ok(command); + await instantiationService.invokeFunction(command.handler); + + assert.deepStrictEqual(calls, [[AICustomizationManagementCommands.OpenEditor, AICustomizationManagementSection.Agents]]); + }); +}); From 3b3374b1b7b57855d763dc1028e04296f732c5a6 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 25 Aug 2026 12:56:10 +0200 Subject: [PATCH 3/4] remove the test --- .../browser/promptSyntax/chatModeActions.ts | 2 +- .../promptSyntax/chatModeActions.test.ts | 35 ------------------- 2 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 src/vs/workbench/contrib/chat/test/browser/promptSyntax/chatModeActions.test.ts diff --git a/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.ts b/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.ts index 0eb695959029c8..f176904b6f15fe 100644 --- a/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.ts +++ b/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.ts @@ -41,7 +41,7 @@ function createPickerConfigureAgentsActionConfig(disabled: boolean) { return config; } -class PickerConfigAgentAction extends ConfigAgentActionImpl { constructor() { super(createPickerConfigureAgentsActionConfig(false)); } } +export class PickerConfigAgentAction extends ConfigAgentActionImpl { constructor() { super(createPickerConfigureAgentsActionConfig(false)); } } class PickerConfigAgentActionDisabled extends ConfigAgentActionImpl { constructor() { super(createPickerConfigureAgentsActionConfig(true)); } } /** diff --git a/src/vs/workbench/contrib/chat/test/browser/promptSyntax/chatModeActions.test.ts b/src/vs/workbench/contrib/chat/test/browser/promptSyntax/chatModeActions.test.ts deleted file mode 100644 index 2144dd58293683..00000000000000 --- a/src/vs/workbench/contrib/chat/test/browser/promptSyntax/chatModeActions.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -import assert from 'assert'; -import { mock } from '../../../../../../base/test/common/mock.js'; -import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../../../base/test/common/utils.js'; -import { ICommandService, CommandsRegistry } from '../../../../../../platform/commands/common/commands.js'; -import { TestInstantiationService } from '../../../../../../platform/instantiation/test/common/instantiationServiceMock.js'; -import { AICustomizationManagementCommands, AICustomizationManagementSection } from '../../../browser/aiCustomization/aiCustomizationManagement.js'; -import { registerAgentActions } from '../../../browser/promptSyntax/chatModeActions.js'; - -registerAgentActions(); - -suite('Chat mode actions', () => { - const store = ensureNoDisposablesAreLeakedInTestSuite(); - - test('Configure Custom Agents opens the Agents customizations section', async () => { - const instantiationService = store.add(new TestInstantiationService()); - const calls: unknown[][] = []; - instantiationService.stub(ICommandService, new class extends mock() { - override async executeCommand(commandId: string, ...args: unknown[]): Promise { - calls.push([commandId, ...args]); - return undefined; - } - }()); - - const command = CommandsRegistry.getCommand('workbench.action.chat.picker.customagents'); - assert.ok(command); - await instantiationService.invokeFunction(command.handler); - - assert.deepStrictEqual(calls, [[AICustomizationManagementCommands.OpenEditor, AICustomizationManagementSection.Agents]]); - }); -}); From f70a7eb423487cddb78af9a7efdd29fff177c3aa Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 25 Aug 2026 12:57:02 +0200 Subject: [PATCH 4/4] update --- .../contrib/chat/browser/promptSyntax/chatModeActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.ts b/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.ts index f176904b6f15fe..0eb695959029c8 100644 --- a/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.ts +++ b/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.ts @@ -41,7 +41,7 @@ function createPickerConfigureAgentsActionConfig(disabled: boolean) { return config; } -export class PickerConfigAgentAction extends ConfigAgentActionImpl { constructor() { super(createPickerConfigureAgentsActionConfig(false)); } } +class PickerConfigAgentAction extends ConfigAgentActionImpl { constructor() { super(createPickerConfigureAgentsActionConfig(false)); } } class PickerConfigAgentActionDisabled extends ConfigAgentActionImpl { constructor() { super(createPickerConfigureAgentsActionConfig(true)); } } /**