Skip to content

itemProvider.provideCustomAgents to get agents from SessionCustomization.agents#317848

Open
aeschli wants to merge 4 commits into
mainfrom
aeschli/underlying-wolf-350
Open

itemProvider.provideCustomAgents to get agents from SessionCustomization.agents#317848
aeschli wants to merge 4 commits into
mainfrom
aeschli/underlying-wolf-350

Conversation

@aeschli
Copy link
Copy Markdown
Contributor

@aeschli aeschli commented May 21, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 21, 2026 20:53
@aeschli aeschli enabled auto-merge (squash) May 21, 2026 20:53
@aeschli aeschli self-assigned this May 21, 2026
DonJayamanne
DonJayamanne previously approved these changes May 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a dedicated ICustomizationItemProvider.provideCustomAgents API so session-scoped harnesses (notably agent-host sessions) can supply custom agents directly from resolved SessionCustomization.agents, and it removes the experimental setting/branching so the chat mode picker always sources custom agents via ICustomizationHarnessService.

Changes:

  • Introduces ICustomizationAgentRef + optional provideCustomAgents on ICustomizationItemProvider, and updates CustomizationHarnessServiceBase.getCustomAgents to prefer it when present.
  • Removes chat.customizations.useChatSessionCustomizationsForCustomAgents and updates ChatModes to always load custom agents from the harness service.
  • Adds provideCustomAgents implementations for agent-host and prompts-service-backed providers.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/common/customizationHarnessService.ts Adds ICustomizationAgentRef/provideCustomAgents and makes getCustomAgents prefer provider-supplied agent refs.
src/vs/workbench/contrib/chat/common/constants.ts Removes the UseChatSessionCustomizationsForCustomAgents config key.
src/vs/workbench/contrib/chat/common/chatModes.ts Always loads custom agents via ICustomizationHarnessService (drops the config switch and prompts-service listener).
src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts Removes the corresponding configuration contribution.
src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.ts Adds provideCustomAgents for the prompts-service adapter provider.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.ts Adds provideCustomAgents that reads resolved agents from session customizations.

Copilot's findings

  • Files reviewed: 6/6 changed files
  • Comments generated: 3

Comment on lines +716 to +731
if (harness.itemProvider.provideCustomAgents) {
const items = await harness.itemProvider.provideCustomAgents(sessionResource, token);
if (items) {
const result: ICustomAgent[] = [];
for (const item of items) {
const promptFile = await this.promptsService.parseNew(item.uri, token);
const extra = {
name: item.name,
description: item.description,
sessionTypes: [sessionType],
hooks: undefined,
source: { storage: PromptsStorage.local } satisfies IAgentSource,
type: PromptsType.agent,
enabled: true,
};
result.push(CustomAgent.fromParsedPromptFile(promptFile, extra));
Comment on lines +143 to +151
async provideCustomAgents(sessionResource: URI): Promise<readonly ICustomizationAgentRef[]> {
const sessionCustomizations = this.getSessionCustomizations(sessionResource);
const agents = sessionCustomizations.flatMap(c => c.agents ?? []);
return agents.map(agent => ({
uri: this.toRemoteUri(agent.uri),
name: agent.name,
description: agent.description,
}));
}
Comment on lines +58 to +61
async provideCustomAgents(sessionResource: URI, token: CancellationToken): Promise<readonly ICustomizationAgentRef[]> {
const agents = await this.promptsService.getCustomAgents(token);
return agents.map(agent => ({ uri: agent.uri, name: agent.name, description: agent.description } satisfies ICustomizationAgentRef));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants