Josh Spicer d7c19c5af6 chat: replace chatSessionCustomizations with chatSessionCustomizationProvider API (#303017)
* feat: add chat.registerCustomizationProvider extension API

Introduces a new proposed extension API (chatCustomizationProvider) that
enables extensions to register as customization providers for the AI
Customization UI. This replaces core-based harness filtering with
extension-driven discovery.

Key changes:
- New proposed API: vscode.proposed.chatCustomizationProvider.d.ts
  - ChatCustomizationProvider, ChatCustomizationItem, ChatCustomizationType
  - chat.registerCustomizationProvider(id, metadata, provider)
- ExtHost/MainThread RPC bridge for provider registration
- ICustomizationHarnessService extended with registerExternalHarness()
  for dynamic harness registration from extensions
- IHarnessDescriptor.itemProvider for extension-driven item discovery
- AICustomizationListWidget falls through to provider when active
  harness has an itemProvider
- Unit tests for dynamic harness registration and lifecycle

The static CLI/Claude harness descriptors remain as fallback until
extensions adopt the new API.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: address code review issues

- Register chatCustomizationProvider in extensionsApiProposals.ts
- Fix duplicate 'descriptor' variable in fetchItemsForSection
- Add missing IExternalCustomizationItemProvider import

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: make management editor reactive to dynamic harness registration

- Track availableHarnesses in autorun (not just activeHarness)
- Add ensureHarnessDropdown() to lazily create/remove the dropdown
  when harnesses are dynamically registered/unregistered
- Store sidebarContent and harnessDropdownContainer refs for
  dynamic dropdown management

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor: address API review feedback for ChatCustomizationProvider

- Replace ChatCustomizationType enum with TaskGroup-style class pattern
  (static instances with string-backed ids, extensible via constructor)
- Rename provideCustomizations → provideChatCustomizations to match
  VS Code provider naming conventions
- Add comprehensive JSDoc explaining customization lifecycle and
  caching semantics (cached until onDidChange fires)
- Simplify type converter to use class id directly
- Bump proposal version to 2

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: quality improvements for ChatCustomizationProvider plumbing

- Skip storage-based grouping for provider-backed items in the
  customization list widget. External providers manage their own
  items, so Workspace/User/Extension categories don't apply —
  render a flat sorted list instead.
- Use AICustomizationManagementSection constants instead of
  hardcoded string literals in hiddenSections mapping.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor: make storage optional on IAICustomizationListItem

External provider items don't have a storage origin — the provider
manages discovery, so Workspace/User/Extension categories don't
apply. Make the storage field optional:

- Provider items omit storage entirely (no fake PromptsStorage.local)
- Context key overlay only sets storage key when present
- Management editor falls back gracefully for provider items
- Debug panel accepts optional storage
- Built-in path (promptsService) is unchanged — items always have storage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: include external provider data in customization debug report

When the active harness has an external provider, the debug report
now shows the provider's raw items grouped by type, with name, URI,
and description for each item, plus a count of items matching the
current section. The promptsService stages are skipped since they
don't apply to provider-backed harnesses.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor: rename ChatCustomization → ChatSessionCustomization per API review

Renames all types, methods, events, DTOs, and the proposal file to use
the ChatSession prefix as requested in API review feedback.

- ChatCustomizationType → ChatSessionCustomizationType
- ChatCustomizationItem → ChatSessionCustomizationItem
- ChatCustomizationProvider → ChatSessionCustomizationProvider
- provideChatCustomizations → provideChatSessionCustomizations
- onDidChangeChatCustomizations → onDidChangeChatSessionCustomizations
- registerCustomizationProvider → registerChatSessionCustomizationProvider
- Proposal: chatCustomizationProvider → chatSessionCustomizationProvider

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: resolve rebase conflicts and remove old ChatSessionCustomizations API

Remove the old group-based ChatSessionCustomizations API from the merged
PR #304532, which is superseded by our new ChatSessionCustomizationProvider
API. The old API used groups, storageLocation, and commands on the
chatSessionsService path; the new API uses a flat item model on the
customizationHarnessService path.

Removed:
- IChatSessionCustomizationItem/Group DTOs from extHost.protocol.ts
- registerChatSessionCustomizationsProvider from extHostChatSessions.ts,
  mainThreadChatSessions.ts, extHost.api.impl.ts, chatSessionsProvider.d.ts
- ChatSessionCustomizations converter namespace from extHostTypeConverters.ts
- mapProviderItemToListItem and old group command fields from list widget

Fixed:
- registerContributedHarness → registerExternalHarness in fixtures and
  mainThreadChatSessions.ts
- Missing AGENT_MD_FILENAME import in customizationHarnessService.ts
- Constructor arg mismatch in browser customizationHarnessService.ts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: remove version number from new chatSessionCustomizationProvider proposal

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: rename id → chatSessionType in registerChatSessionCustomizationProvider

Aligns the parameter name with the chatSessions API convention.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: add AICustomizationManagementCreateMenuId for extension create actions

Extensions can now contribute create/add button actions to the
customizations management editor via contributes.menus targeting
'AICustomizationManagementCreate'. Use the aiCustomizationManagementSection
context key to scope commands to specific sections (agents, skills, etc.).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: register chat/customizations/create as extension menu contribution point

Extensions contribute to 'chat/customizations/create' in package.json
contributes.menus, gated by chatSessionCustomizationProvider proposal.
Uses MenuId.for() to avoid cross-layer import.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: scope create menu to active harness, replace built-in actions

Add aiCustomizationManagementHarness context key set to the active
harness ID. Extensions scope create menu contributions using
'when: aiCustomizationManagementHarness == myHarness'.

When a harness has menu-contributed create actions, they fully replace
the built-in create buttons for that section.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: address code review feedback

- Provider items without storage are now read-only (not editable/deletable)
- Wrap provideChatSessionCustomizations in try/catch to handle extension errors
- Use menuItem.run() instead of commandService.executeCommand for menu actions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: gate customization provider registration on kill-switch setting

Registration is now blocked when chat.customizations.providerApi.enabled
is false (default), preventing providers from affecting the UI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-27 13:42:19 +11:00
2026-03-24 12:05:30 +01:00
2026-03-03 10:57:52 -08:00
2026-03-16 14:51:48 +00:00
2026-03-24 12:05:30 +01:00
2026-03-24 12:05:30 +01:00

Visual Studio Code - Open Source ("Code - OSS")

Feature Requests Bugs Gitter

The Repository

This repository ("Code - OSS") is where we (Microsoft) develop the Visual Studio Code product together with the community. Not only do we work on code and issues here, we also publish our roadmap, monthly iteration plans, and our endgame plans. This source code is available to everyone under the standard MIT license.

Visual Studio Code

VS Code in action

Visual Studio Code is a distribution of the Code - OSS repository with Microsoft-specific customizations released under a traditional Microsoft product license.

Visual Studio Code combines the simplicity of a code editor with what developers need for their core edit-build-debug cycle. It provides comprehensive code editing, navigation, and understanding support along with lightweight debugging, a rich extensibility model, and lightweight integration with existing tools.

Visual Studio Code is updated monthly with new features and bug fixes. You can download it for Windows, macOS, and Linux on Visual Studio Code's website. To get the latest releases every day, install the Insiders build.

Contributing

There are many ways in which you can participate in this project, for example:

If you are interested in fixing issues and contributing directly to the code base, please see the document How to Contribute, which covers the following:

Feedback

See our wiki for a description of each of these channels and information on some other available community-driven channels.

Many of the core components and extensions to VS Code live in their own repositories on GitHub. For example, the node debug adapter and the mono debug adapter repositories are separate from each other. For a complete list, please visit the Related Projects page on our wiki.

Bundled Extensions

VS Code includes a set of built-in extensions located in the extensions folder, including grammars and snippets for many languages. Extensions that provide rich language support (inline suggestions, Go to Definition) for a language have the suffix language-features. For example, the json extension provides coloring for JSON and the json-language-features extension provides rich language support for JSON.

Development Container

This repository includes a Visual Studio Code Dev Containers / GitHub Codespaces development container.

  • For Dev Containers, use the Dev Containers: Clone Repository in Container Volume... command which creates a Docker volume for better disk I/O on macOS and Windows.

    • If you already have VS Code and Docker installed, you can also click here to get started. This will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use.
  • For Codespaces, install the GitHub Codespaces extension in VS Code, and use the Codespaces: Create New Codespace command.

Docker / the Codespace should have at least 4 Cores and 6 GB of RAM (8 GB recommended) to run a full build. See the development container README for more information.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT license.

Languages
TypeScript 73.9%
jsonc 21.3%
CSS 1.4%
C 1%
JavaScript 0.8%
Other 1.5%