chat customizations: fix customization provider harness deduplication, grouping, and badges#305810
Merged
joshspicer merged 9 commits intomainfrom Mar 27, 2026
Merged
chat customizations: fix customization provider harness deduplication, grouping, and badges#305810joshspicer merged 9 commits intomainfrom
joshspicer merged 9 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Chat Customizations editor’s integration with chatSessionCustomizationProvider by fixing harness de-duplication, ensuring provider-supplied items participate in the standard grouping/badging UI, and simplifying the proposed API surface.
Changes:
- De-duplicate static vs. extension-registered harness descriptors when they share the same harness id, and add coverage for replacement/restore behavior.
- Enrich external provider items with inferred storage plus instruction
applyToparsing so they can be grouped/badged like built-in items (and remove the prior flat-list rendering path). - Remove
workspaceSubpathsfrom the proposedChatSessionCustomizationProviderMetadataAPI and its DTO/protocol flow.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.proposed.chatSessionCustomizationProvider.d.ts | Removes workspaceSubpaths from the proposed API metadata surface. |
| src/vs/workbench/contrib/chat/test/common/customizationHarnessService.test.ts | Adds tests covering static harness replacement by an external harness and restoration on dispose. |
| src/vs/workbench/contrib/chat/common/customizationHarnessService.ts | Updates harness enumeration to let external harnesses override static ones by id. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts | Infers storage and enriches provider items (esp. instructions) so they flow through existing grouping/badging logic; removes flat-list short-circuit. |
| src/vs/workbench/api/common/extHostChatAgents2.ts | Removes workspaceSubpaths from metadata DTO creation for provider registration. |
| src/vs/workbench/api/common/extHost.protocol.ts | Removes workspaceSubpaths from the cross-boundary metadata DTO interface. |
| src/vs/workbench/api/browser/mainThreadChatAgents2.ts | Stops wiring workspaceSubpaths into the registered harness descriptor for external providers. |
src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts
Outdated
Show resolved
Hide resolved
…er API Extract the instruction classification logic (applyTo parsing, badge generation, groupKey assignment) into a shared buildInstructionListItem method used by both the built-in and provider item paths. Remove the instruction-specific enrichInstructionItemsFromProvider in favor of inline logic in fetchItemsFromProvider that delegates to the shared helper. Add a section to the chat-customizations-editor skill documenting the chatSessionCustomizationProvider proposed API flow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ping Fix disposal fallback: when an external harness that overrides a static one is disposed, keep the active harness on the same id since the static harness is restored. Only fall back to all[0] when no harness with that id remains. Fix agent instruction grouping: buildInstructionListItem now detects well-known agent instruction files (AGENTS.md, CLAUDE.md, CLAUDE.local.md, copilot-instructions.md) and assigns groupKey 'agent-instructions' so they appear under the correct header for both built-in and provider items. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move instruction enrichment from inline in fetchItemsFromProvider to a post-processing step (enrichProviderInstructionItems) called from fetchItemsForSection. This avoids touching fetchItemsFromProvider's mapping logic which #305813 also modifies. Restore the flat-list early return in filterItems (305813 replaces it with groupKey-based grouping). Drop our inferStorageFromUri in favor of the one 305813 adds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dmitrivMS
previously approved these changes
Mar 27, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pwang347
approved these changes
Mar 27, 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.
Summary
Fixes several issues with the
chatSessionCustomizationProviderAPI integration in the Chat Customizations editor.Harness deduplication
When an extension registers a customization provider with the same ID as a hardcoded harness (e.g. "cli", "claude"), the dropdown showed duplicate entries.
_getAllHarnesses()now filters out static harnesses that are overridden by external ones with the same ID. Disposing the external harness restores the static one.Grouping and badges for provider items
External provider items were rendered as a flat list with no group headers or badges. Now:
local(workspace) oruserbased on the active project root and user home directoryapplyTofrontmatter, producing properbadge/badgeTooltip(e.g.src/vs/platform/agentHost/**) andgroupKeyfor the "Agent Instructions" / "Included Based on Context" / "Loaded on Demand" groupsfilterItemsis removed so provider items flow through the same grouping logic as built-in itemsAPI cleanup
Removed
workspaceSubpathsfrom theChatSessionCustomizationProviderMetadataproposed API and its DTO/protocol chain. Extensions are responsible for contributing only the correct customizations — the host should not filter workspace files on their behalf. The internalIHarnessDescriptor.workspaceSubpathsremains for hardcoded CLI/Claude harnesses.Files changed
customizationHarnessService.ts— dedup logic in_getAllHarnesses()aiCustomizationListWidget.ts—fetchItemsFromProviderenrichment,inferStorageFromUri,enrichInstructionItemsFromProvider, removed flat-list early returnmainThreadChatAgents2.ts/extHostChatAgents2.ts/extHost.protocol.ts— removedworkspaceSubpathsfrom API chainvscode.proposed.chatSessionCustomizationProvider.d.ts— removedworkspaceSubpathsfrom proposed APIcustomizationHarnessService.test.ts— tests for harness replacement and restore-on-dispose