add pluginUri and extensionId to ICustomizationItem: fix slash command qualification#313217
Merged
Conversation
Contributor
|
Base:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds richer provenance metadata (extensionId, pluginUri, and resource source) to chat customization items/resources so the workbench and extension host can correctly attribute items (and qualify plugin-backed slash commands) across providers, UI, and RPC boundaries.
Changes:
- Extend proposed API types to surface customization/resource provenance (
source,extensionId,pluginUri). - Thread new fields through workbench ↔ ext host protocol DTOs and conversion code.
- Adjust AI Customization UI normalization/debug output and qualify plugin slash command names.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.proposed.chatSessionCustomizationProvider.d.ts | Extends customization item proposal with extensionId/pluginUri provenance. |
| src/vscode-dts/vscode.proposed.chatPromptFiles.d.ts | Adds provenance (source, extensionId, pluginUri) to ChatHook. |
| src/vs/workbench/contrib/chat/common/customizationHarnessService.ts | Uses plugin URI to canonicalize plugin slash command names; updates harness item shape. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts | Shows extension provenance in item tooltip (now based on extensionId). |
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.ts | Normalizes items using extensionId/pluginUri instead of extensionLabel; adjusts storage inference. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.ts | Displays extensionId/pluginUri in debug output. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.ts | Propagates plugin/extension provenance into locally enumerated harness items; improves skill naming fallback. |
| src/vs/workbench/api/common/extHostChatAgents2.ts | Includes provenance when mapping customization items and hooks into extension API objects/DTOs. |
| src/vs/workbench/api/common/extHost.protocol.ts | Extends protocol DTOs to carry source, extensionId, and pluginUri. |
| src/vs/workbench/api/browser/mainThreadChatAgents2.ts | Populates provenance fields when sending hooks/items across the boundary. |
| extensions/copilot/src/extension/chatSessions/vscode-node/claudeCustomizationProvider.ts | Populates new provenance fields on Claude customization items. |
| extensions/copilot/src/extension/chatSessions/copilotcli/vscode-node/copilotCLICustomizationProvider.ts | Populates new provenance fields on Copilot CLI customization items. |
Copilot's findings
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/chat/common/customizationHarnessService.ts:171
extensionLabelwas removed fromICustomizationItem, but there is at least one remaining producer that still sets it (src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.ts,applyBuiltinGroupKeys). That will now fail type-checking; update remaining producers/consumers to use the newextensionIdfield (or remove the property assignment) so the code compiles.
/** Storage origin (local, user, extension, plugin). Set by providers that know the source. */
readonly storage?: PromptsStorage;
/** The extension identifier that contributed this customization, if any. */
readonly extensionId: string | undefined;
/** The URI of the plugin that contributed this customization, if any. */
readonly pluginUri: URI | undefined;
src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.ts:274
inferStorageAndGroupno longer has a fallback for non-fileURIs. Items with a custom scheme and noextensionId/pluginUriwill now be inferred asPromptsStorage.user, which breaks existing providers that rely on "non-file scheme => Built-in" (e.g. the Claude provider usesclaude-session:URIs for SDK agents). Consider restoring the old non-file fallback (treat as extension/built-in), or require providers to always setextensionId/groupKeyfor non-file items and update the affected providers accordingly.
private inferStorageAndGroup(item: ICustomizationItem): { storage: PromptsStorage; groupKey?: string; isBuiltin?: boolean; extensionId?: string; pluginUri?: URI } {
const groupKey = item.groupKey;
const isBuiltin = groupKey === BUILTIN_STORAGE;
if (item.extensionId) {
const extensionIdentifier = new ExtensionIdentifier(item.extensionId);
if (isChatExtensionItem(extensionIdentifier, this.productService)) {
return { storage: PromptsStorage.extension, groupKey: BUILTIN_STORAGE, isBuiltin: true, extensionId: item.extensionId };
}
return { storage: PromptsStorage.extension, extensionId: item.extensionId, groupKey, isBuiltin };
}
if (item.pluginUri) {
return { storage: PromptsStorage.plugin, pluginUri: item.pluginUri, groupKey, isBuiltin };
}
const uri = item.uri;
const activeProjectRoot = this.workspaceService.getActiveProjectRoot();
if (activeProjectRoot && isEqualOrParent(uri, activeProjectRoot)) {
return { storage: PromptsStorage.local, groupKey, isBuiltin };
}
for (const folder of this.workspaceContextService.getWorkspace().folders) {
if (isEqualOrParent(uri, folder.uri)) {
return { storage: PromptsStorage.local, groupKey, isBuiltin };
}
}
for (const plugin of this.agentPluginService.plugins.get()) {
if (isEqualOrParent(uri, plugin.uri)) {
return { storage: PromptsStorage.plugin, pluginUri: plugin.uri, groupKey, isBuiltin };
}
}
const extensionId = extractExtensionIdFromPath(uri.path);
if (extensionId) {
const extensionIdentifier = new ExtensionIdentifier(extensionId);
if (isChatExtensionItem(extensionIdentifier, this.productService)) {
return { storage: PromptsStorage.extension, groupKey: BUILTIN_STORAGE, isBuiltin: true, extensionId };
}
return { storage: PromptsStorage.extension, extensionId, groupKey, isBuiltin };
}
return { storage: PromptsStorage.user };
- Files reviewed: 10/12 changed files
- Comments generated: 3
jrieken
approved these changes
Apr 29, 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.