Skip to content

agentHost: collect client customizations without the local prompts service - #350401

Draft
Martin Aeschlimann (aeschli) wants to merge 1 commit into
mainfrom
aeschli/agents/refactor-agent-host-customizations
Draft

Martin Aeschlimann (aeschli) wants to merge 1 commit into
mainfrom
aeschli/agents/refactor-agent-host-customizations

Conversation

@aeschli

@aeschli Martin Aeschlimann (aeschli) commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

First step towards removing the agent host's dependency on IPromptsService, which was designed for the local harness. Agent hosts now get client customizations from services that are independent of any harness.

What changed

  • IChatExtensionCustomizationsService (chat/common): the formerly private ExtensionPromptFileService as a registered service. The contribution-point handler and mainThreadChatAgents2 register contributions and providers through it; registerContributedFile and registerPromptFileProvider are removed from IPromptsService.
  • IAgenticSkillsService: owns the built-in skills of the Agents window and their disabled state (chat.agenticSkills.disabled). A no-op implementation is registered in the workbench; the Agents window registers the real one, replacing the AgenticPromptsService subclass. PromptsService reads built-in skills from it and routes get/setDisabledPromptFiles for built-in skills to it, migrating existing entries from chat.disabledPromptFiles.skill once.
  • IAgentPlugin.discovery (configured | marketplace | extension | harness): records which discovery found a plugin. fromMarketplace can't tell, as configured plugins also carry marketplace metadata.
  • IAgentHostClientCustomizationsService: collects what the client forwards to an agent host (extension files, built-in skills, configured-location and, for remote hosts, user files; plugins; MCP servers) and owns the combined change event. AgentCustomizationScope only turns snapshots into published customizations. Plugins come straight from IAgentPluginService instead of plugin prompt files.

Behavior

Intended to be unchanged. The draft custom agent picker now reads plugin agents from IAgentPlugin.agents instead of plugin prompt files, still omitting agents of effectively disabled plugins and agents opted out of syncing. Plugin refs are published in IAgentPluginService order instead of an order that depended on whether plugin prompt files had been read yet. The disabled built-in skill migration runs when AgenticSkillsService is created, before any read.

Not in this PR

  • Configured-location and user files are still listed through IPromptsService.
  • getHooksNotRunning in the item provider still uses IPromptsService.
  • Stopping forwarding of plugins installed from the legacy local marketplace (now a filter on discovery, but needs a migration story).

Validation

  • pnpm run typecheck-client: passed
  • pnpm run oxlint <changed files>: passed
  • ./scripts/test.sh --run <22 affected test files> (promptsService, computeAutomaticInstructions, appearanceTools, agentCustomizationItemProvider, enumerateLocalCustomizationsForHarness, resolveCustomizationRefs, agentHostClientTools, agentHostChatContribution, remote agent host harness, plugin and mainThreadChatAgents2 tests, among others): 3035 passing; after the review fixes, the 15 most affected files again (1685 passing)
  • Not run: integration tests, manual testing in a running build.

…rvice

Moves extension-contributed customizations into IChatExtensionCustomizationsService and Agents-window built-in skills (with their disabled state) into IAgenticSkillsService, replacing the AgenticPromptsService subclass. Adds IAgentHostClientCustomizationsService, which collects the files, plugins and MCP servers that the client forwards to agent hosts, so that AgentCustomizationScope only handles publication. Plugins now record which discovery found them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 25, 2026 15:38
@github-actions

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: ba9af887 Current: 2d64b035

Changed (1)

chat/chatSubagentContent/ThinkingAcrossCompletion/Light
Before After
before after

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Draft agents from disabled plugins are marked enabled and become selectable before host discovery or when no agents are returned, requiring restoration of the enablement filter and a regression test.

1 open issue
What changed in this PR

This PR begins separating Agent Host customization collection from the local IPromptsService, while retaining that service for configured-location and user files.

Changes:

  • Extracts extension customizations and built-in skills into dedicated services, including disabled-skill state migration.
  • Adds plugin discovery provenance and a shared client customization collector; publication consumes its snapshots.
  • Updates draft agent discovery, service registrations, tests, and fixtures for the new boundaries.
File Description
src/​vs/​workbench/​test/​browser/​componentFixtures/​sessions/​aiCustomizationOrganization.fixture.ts Supplies the new customization service dependencies.
src/​vs/​workbench/​contrib/​chat/​test/​common/​promptSyntax/​service/​promptsService.test.ts Updates registration tests and adds disabled-skill migration coverage.
src/​vs/​workbench/​contrib/​chat/​test/​common/​promptSyntax/​computeAutomaticInstructions.test.ts Wires extracted services into instruction tests.
src/​vs/​workbench/​contrib/​chat/​test/​common/​plugins/​copilotCliAgentPluginDiscovery.test.ts Adds discovery provenance to a plugin fixture.
src/​vs/​workbench/​contrib/​chat/​test/​common/​plugins/​agentPluginFormatDetection.test.ts Declares the test discovery implementation’s kind.
src/​vs/​workbench/​contrib/​chat/​test/​common/​plugins/​agentPluginEnablement.test.ts Adds discovery provenance to enablement fixtures.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​remoteAgentHost/​remoteAgentHostCustomizationHarness.test.ts Updates remote customization test dependencies.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​plugins/​agentPluginItems.test.ts Updates plugin fixtures for the expanded interface.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​aiCustomization/​aiCustomizationItemsModel.test.ts Adds discovery provenance to model fixtures.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​workbenchAgentHostCustomizationService.test.ts Supplies extracted services to the item provider.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​resolveCustomizationRefs.test.ts Adapts publication and draft-agent tests to snapshots.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​localCustomizationSourcesTestUtils.ts Adds shared customization source and collector helpers.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​enumerateLocalCustomizationsForHarness.test.ts Exercises file enumeration through the collector.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostSkillDiscoveryTestUtils.ts Updates skill-discovery test dependencies.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostClientTools.test.ts Wires the collector into active-client tests.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostChatContribution.test.ts Adds customization service stubs.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentCustomizationItemProvider.test.ts Separates extension, prompt, and built-in skill test sources.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentPluginActions.test.ts Adds discovery provenance to action fixtures.
src/​vs/​workbench/​contrib/​chat/​common/​promptSyntax/​service/​promptsServiceImpl.ts Delegates extension and built-in discovery; migrates disabled skills.
src/​vs/​workbench/​contrib/​chat/​common/​promptSyntax/​service/​promptsService.ts Removes extension registration APIs and the toggleability helper.
src/​vs/​workbench/​contrib/​chat/​common/​promptSyntax/​service/​disabledPromptFilesStorage.ts Extracts disabled-URI persistence helpers.
src/​vs/​workbench/​contrib/​chat/​common/​promptSyntax/​service/​chatExtensionCustomizationsServiceImpl.ts Promotes extension discovery to a dedicated service implementation.
src/​vs/​workbench/​contrib/​chat/​common/​promptSyntax/​service/​chatExtensionCustomizationsService.ts Defines the extension customization service contract.
src/​vs/​workbench/​contrib/​chat/​common/​promptSyntax/​service/​agenticSkillsService.ts Defines built-in skill ownership and a no-op implementation.
src/​vs/​workbench/​contrib/​chat/​common/​promptSyntax/​chatPromptFilesContribution.ts Routes extension contributions to the dedicated service.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​agentPluginServiceImpl.ts Records each plugin’s discovery source.
src/​vs/​workbench/​contrib/​chat/​common/​plugins/​agentPluginService.ts Adds the plugin discovery-kind contract.
src/​vs/​workbench/​contrib/​chat/​browser/​chat.shared.contribution.ts Registers the shared customization services.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostLocalCustomizations.ts Converts snapshots into published refs and draft agents.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostClientCustomizationsService.ts Collects customization snapshots and combines change notifications.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostActiveClientService.ts Uses the collector for customization scope updates.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentCustomizationItemProvider.ts Reads extension metadata and built-in skills from their owners.
src/​vs/​workbench/​api/​browser/​mainThreadChatAgents2.ts Registers extension providers through the new service.
src/​vs/​sessions/​test/​ai-customizations.test.md Updates a service name in a test-plan note.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​appearanceTools.test.ts Adapts built-in skill tests to the extracted services.
src/​vs/​sessions/​contrib/​chat/​browser/​chat.contribution.ts Registers the Agents window’s built-in skill service.
src/​vs/​sessions/​contrib/​chat/​browser/​agenticSkillsService.ts Replaces the prompts subclass with standalone skill discovery and disabled-state ownership.

Review effort: Balanced

Comment on lines +46 to +48
for (const { plugin } of snapshot.plugins) {
if (plugin.discovery !== 'harness' || isContributionEnabled(plugin.enablement.get())) {
candidates.push(...plugin.agents.get());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 1e3200c. The collector now computes each plugin's selectable agents and applies isContributionEnabled(plugin.enablement.get()) to every plugin, not only harness-owned ones, so disabled plugins contribute no draft agents. It also leaves out agents that were opted out of syncing. New tests in resolveCustomizationRefs.test.ts cover a workspace-disabled plugin and an opted-out agent; the existing harness test covers DisabledProfile.

This branch has not been deployed

No deployments
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.

2 participants