Skip to content

add pluginUri and extensionId to ICustomizationItem: fix slash command qualification#313217

Merged
aeschli merged 5 commits into
mainfrom
aeschli/broad-stingray-194
Apr 29, 2026
Merged

add pluginUri and extensionId to ICustomizationItem: fix slash command qualification#313217
aeschli merged 5 commits into
mainfrom
aeschli/broad-stingray-194

Conversation

@aeschli
Copy link
Copy Markdown
Contributor

@aeschli aeschli commented Apr 29, 2026

No description provided.

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

github-actions Bot commented Apr 29, 2026

Base: 34402873 Current: 26c7435c

No screenshot changes.

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

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

  • extensionLabel was removed from ICustomizationItem, 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 new extensionId field (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

  • inferStorageAndGroup no longer has a fallback for non-file URIs. Items with a custom scheme and no extensionId/pluginUri will now be inferred as PromptsStorage.user, which breaks existing providers that rely on "non-file scheme => Built-in" (e.g. the Claude provider uses claude-session: URIs for SDK agents). Consider restoring the old non-file fallback (treat as extension/built-in), or require providers to always set extensionId/groupKey for 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

Comment thread src/vs/workbench/contrib/chat/common/customizationHarnessService.ts
aeschli and others added 4 commits April 29, 2026 15:35
…agentHostLocalCustomizations.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@aeschli aeschli merged commit 21ef72b into main Apr 29, 2026
41 of 42 checks passed
@aeschli aeschli deleted the aeschli/broad-stingray-194 branch April 29, 2026 15:35
@vs-code-engineering vs-code-engineering Bot added this to the 1.119.0 milestone Apr 29, 2026
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.

3 participants