Skip to content

chat customizations: add ChatResourceEnablement#310212

Draft
aeschli wants to merge 2 commits intomainfrom
aeschli/lost-flamingo-964
Draft

chat customizations: add ChatResourceEnablement#310212
aeschli wants to merge 2 commits intomainfrom
aeschli/lost-flamingo-964

Conversation

@aeschli
Copy link
Copy Markdown
Contributor

@aeschli aeschli commented Apr 15, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 15, 2026 19:46
@aeschli aeschli enabled auto-merge (squash) April 15, 2026 19:46
@aeschli aeschli self-assigned this Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

Screenshot Changes

Base: 7a79f779 Current: 0a4a1f0e

Changed (1)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after

blocks-ci screenshots changed

Replace the contents of test/componentFixtures/blocks-ci-screenshots.md with:

Updated blocks-ci-screenshots.md
<!-- auto-generated by CI — do not edit manually -->

#### editor/codeEditor/CodeEditor/Dark
![screenshot](https://hediet-screenshots.azurewebsites.net/images/cb32a3e854b5734fe5aaca2318f2e0a42ee821b05ea97883ea42c5ba95edb3c3)

#### editor/codeEditor/CodeEditor/Light
![screenshot](https://hediet-screenshots.azurewebsites.net/images/42624fbba5e0db7f32c224b5eb9c5dd3b08245697ae2e7d2a88be0d7c287129b)

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 introduces “enablement” metadata for chat customization resources (agents, instructions, prompts, skills, etc.) so the platform and extension API can preserve and propagate conditions describing when a contributed resource should be offered.

Changes:

  • Add *Enablement metadata types and optional enablement fields to prompt/customization models and proposed VS Code API types.
  • Plumb enablement through prompt discovery, contribution registration, and ext-host/main-thread DTO conversions.
  • Extend tests to validate that enablement metadata is preserved for contributed files and provider-returned resources.
Show a summary per file
File Description
src/vscode-dts/vscode.proposed.chatPromptFiles.d.ts Adds ChatResourceEnablement and enablement fields; adjusts hooks/plugins API return types.
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.ts Introduces IPromptFileEnablement and adds enablement to core prompt/customization interfaces.
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts Propagates enablement from prompt paths into resolved agent/instruction/skill/slash-command models and contributed file registrations.
src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.ts Extends extension-point schema and registration flow to accept and forward enablement.
src/vs/workbench/api/common/extHost.protocol.ts Adds IChatResourceEnablementDto and includes enablement on resource DTOs.
src/vs/workbench/api/browser/mainThreadChatAgents2.ts Includes enablement when mapping core models to DTOs sent to the extension host.
src/vs/workbench/api/common/extHostChatAgents2.ts Includes enablement when reviving DTOs into extension API objects.
src/vs/workbench/api/common/extHost.api.impl.ts Updates API typings for hooks/plugins getters to return ChatHook[] / ChatPlugin[].
src/vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test.ts Updates expectations and adds coverage for enablement preservation from contributions/providers.
src/vs/workbench/contrib/chat/test/common/promptSyntax/service/mockPromptsService.ts Updates mock service signature for contributed file registration to include enablement.
src/vs/platform/extensions/common/extensions.ts Extends contribution typings with enablement for chat file contributions.

Copilot's findings

  • Files reviewed: 10/11 changed files
  • Comments generated: 1

Comment on lines 207 to 213
export interface IChatFileContribution {
readonly path: string;
readonly name?: string;
readonly description?: string;
readonly when?: string;
readonly enablement?: IChatFileContributionEnablement;
}
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

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

IChatFileContribution now allows enablement, but the chatPlugins extension point schema currently rejects unknown properties (additionalProperties: false) and only supports { path, when } (see agentPluginServiceImpl.ts around the epPlugins schema). This creates a mismatch where contributes.chatPlugins[].enablement is type-allowed but will be rejected at runtime. Either extend the chatPlugins schema/handling to accept enablement, or avoid adding enablement to the shared IChatFileContribution shape used by chatPlugins.

Copilot uses AI. Check for mistakes.
@aeschli aeschli marked this pull request as draft April 15, 2026 20:02
auto-merge was automatically disabled April 15, 2026 20:02

Pull request was converted to draft

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