itemProvider.provideCustomAgents to get agents from SessionCustomization.agents#317848
Open
aeschli wants to merge 4 commits into
Open
itemProvider.provideCustomAgents to get agents from SessionCustomization.agents#317848aeschli wants to merge 4 commits into
aeschli wants to merge 4 commits into
Conversation
DonJayamanne
previously approved these changes
May 21, 2026
Contributor
There was a problem hiding this comment.
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+ optionalprovideCustomAgentsonICustomizationItemProvider, and updatesCustomizationHarnessServiceBase.getCustomAgentsto prefer it when present. - Removes
chat.customizations.useChatSessionCustomizationsForCustomAgentsand updatesChatModesto always load custom agents from the harness service. - Adds
provideCustomAgentsimplementations 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)); | ||
| } |
roblourens
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.