chat: remove providerApi.enabled setting and legacy code paths#308341
chat: remove providerApi.enabled setting and legacy code paths#308341joshspicer merged 3 commits intomainfrom
Conversation
Screenshot ChangesBase: Changed (36)Removed (2) |
There was a problem hiding this comment.
Pull request overview
Removes the now-obsolete chat.customizations.providerApi.enabled setting and deletes legacy/non-provider code paths, aligning the Chat Customizations UI and harness registration with the “provider API always enabled” direction.
Changes:
- Removed the
chat.customizations.providerApi.enabledconfiguration key and all related conditional logic/guards. - Simplified harness registration to only statically register the Local (VS Code) harness in core; other harnesses are expected via provider API.
- Deleted the legacy “core promptsService discovery” path in the Chat Customizations list widget and removed the Claude harness implementation/docs/fixtures.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/test/browser/componentFixtures/sessions/aiCustomizationManagementEditor.fixture.ts | Removes Claude harness fixture/imports from the management editor fixture setup. |
| src/vs/workbench/contrib/chat/common/customizationHarnessService.ts | Removes Claude harness enum + descriptor factory and updates related comments/helpers. |
| src/vs/workbench/contrib/chat/common/constants.ts | Removes ChatConfiguration.CustomizationsProviderApi enum entry. |
| src/vs/workbench/contrib/chat/browser/chat.contribution.ts | Removes the configuration registration for the provider API setting; updates harness selector setting description. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.ts | Removes config/path-service based conditional harness registration; now always registers only Local harness statically. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts | Deletes the legacy core discovery/filtering pipeline and makes the widget provider-driven. |
| src/vs/workbench/api/browser/mainThreadChatAgents2.ts | Removes kill-switch listener and provider-API guard; always accepts provider registrations (except sessions window). |
| src/vs/sessions/AI_CUSTOMIZATIONS.md | Updates documentation to remove Claude harness references and reflect provider-based harness contributions. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts:845
- The context-menu copy actions unconditionally use
item.uri.fsPath. For non-fileURIs (which are possible in the provider path, and are explicitly treated as “built-in” by_inferStorageAndGroup),fsPathcan be empty/meaningless, so “Copy Full Path/Relative Path” will copy incorrect values. Consider only showing these actions forSchemas.fileURIs, or copyingitem.uri.toString()(and only enabling relative-path copying when a workspace root exists and the URI is under it).
// Add copy path actions
const copyActions = [
new Separator(),
new Action('copyFullPath', localize('copyFullPath', "Copy Full Path"), undefined, true, async () => {
await this.clipboardService.writeText(item.uri.fsPath);
}),
new Action('copyRelativePath', localize('copyRelativePath', "Copy Relative Path"), undefined, true, async () => {
const basePath = this.workspaceService.getActiveProjectRoot();
if (basePath && item.uri.fsPath.startsWith(basePath.fsPath)) {
const relative = item.uri.fsPath.substring(basePath.fsPath.length + 1);
await this.clipboardService.writeText(relative);
} else {
// Fallback to workspace-relative via label service
const relativePath = this.labelService.getUriLabel(item.uri, { relative: true });
await this.clipboardService.writeText(relativePath);
}
}),
- Files reviewed: 8/8 changed files
- Comments generated: 1
bb61374 to
11f3cab
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes the chat.customizations.providerApi.enabled kill-switch and deletes legacy “core discovery” / Claude harness code paths, assuming the customization provider API is always enabled. It simplifies harness registration in core VS Code to only the Local/VSCode harness and updates related docs/fixtures accordingly.
Changes:
- Removed
chat.customizations.providerApi.enabledconfiguration and all guards/listeners around it. - Removed the Claude harness implementation and fixture coverage.
- Deleted the legacy “core promptsService discovery + filtering” path from the AI Customizations list widget, leaving only provider-backed listing.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/test/browser/componentFixtures/sessions/aiCustomizationManagementEditor.fixture.ts | Removes Claude harness fixture usage and related imports. |
| src/vs/workbench/contrib/chat/common/customizationHarnessService.ts | Removes CustomizationHarness.Claude, getClaudeUserRoots, and createClaudeHarnessDescriptor. |
| src/vs/workbench/contrib/chat/common/constants.ts | Removes ChatConfiguration.CustomizationsProviderApi enum entry. |
| src/vs/workbench/contrib/chat/browser/chat.contribution.ts | Removes the setting registration and updates harness selector description text. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.ts | Simplifies core harness service to always register only the VSCode/Local harness. |
| src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts | Removes the legacy core-item pipeline and makes the widget provider-only. |
| src/vs/workbench/api/browser/mainThreadChatAgents2.ts | Removes kill-switch listener and provider registration guard based on the removed setting. |
| src/vs/sessions/AI_CUSTOMIZATIONS.md | Updates documentation to remove Claude harness references and reflect provider-driven harnesses in core. |
Copilot's findings
Comments suppressed due to low confidence (3)
src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts:1203
fetchItemsForSectionnow returns an empty list when the active harness has noitemProvider. The static Local/VSCode harness created bycreateVSCodeHarnessDescriptordoes not setitemProvider, and I can't find any extension registering a customization provider for session type'vscode'(e.g.extensions/copilotonly registers forcopilotcliand the Claude scheme). This likely makes the Chat Customizations editor show no items when the Local harness is active (including when the harness selector is disabled and the editor forcesCustomizationHarness.VSCode). Consider restoring a promptsService-based fallback for harnesses withoutitemProvider, or attach a built-initemProviderto the VSCode harness so Local always lists core items.
private async fetchItemsForSection(section: AICustomizationManagementSection): Promise<IAICustomizationListItem[]> {
const promptType = sectionToPromptType(section);
const activeDescriptor = this.harnessService.getActiveDescriptor();
if (activeDescriptor.itemProvider && promptType) {
return this.fetchProviderItemsForSection(activeDescriptor, promptType);
}
return [];
}
src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts:1599
filterItems()now always callsfilterItemsForProvider, even when the active harness has noitemProvider(Local/VSCode) andallItemswould be empty under the new logic. If the intent is to make provider-backed harnesses the only supported path, it would be clearer to either (1) ensure the VSCode harness is always provider-backed, or (2) keep a separate filtering/grouping path for Local harness so the UI continues to work without an external provider.
private filterItems(): number {
const matchedItems = this.applySearchFilter(this.allItems);
this.filterItemsForProvider(matchedItems);
return matchedItems.length;
}
src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.ts:846
- The context menu now always adds “Copy Full Path/Copy Relative Path” actions and writes
item.uri.fsPath. For non-fileschemes (and for synthetic/built-in items),fsPath/relative path computations can be meaningless or misleading. Consider gating these actions toitem.uri.scheme === Schemas.file(and possibly workspace/local/user storages), and offering a separate “Copy URI” action for non-file items.
This issue also appears in the following locations of the same file:
- line 1194
- line 1595
// Add copy path actions
const copyActions = [
new Separator(),
new Action('copyFullPath', localize('copyFullPath', "Copy Full Path"), undefined, true, async () => {
await this.clipboardService.writeText(item.uri.fsPath);
}),
new Action('copyRelativePath', localize('copyRelativePath', "Copy Relative Path"), undefined, true, async () => {
const basePath = this.workspaceService.getActiveProjectRoot();
if (basePath && item.uri.fsPath.startsWith(basePath.fsPath)) {
const relative = item.uri.fsPath.substring(basePath.fsPath.length + 1);
await this.clipboardService.writeText(relative);
} else {
// Fallback to workspace-relative via label service
const relativePath = this.labelService.getUriLabel(item.uri, { relative: true });
await this.clipboardService.writeText(relativePath);
}
}),
];
- Files reviewed: 8/8 changed files
- Comments generated: 0 new
The provider API is now permanently enabled. Remove the chat.customizations.providerApi.enabled setting, the false-path conditional that registered built-in CLI/Claude harnesses in core, the entire fetchCoreItemsForSection legacy item-loading pipeline, and related dead code (filterItemsForCore, applyBuiltinGroupKeys, storageToIcon, findPluginUri, isBuiltin/extensionLabel properties, kill-switch listener in mainThreadChatAgents2). CLI harness code is preserved for the sessions window. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
11f3cab to
f1ee67d
Compare
…mProvider After removing fetchCoreItemsForSection (the IPromptsService fallback path), the sessions CLI harness had no itemProvider, causing the management editor to return [] for all sections while sidebar counts remained correct. Fix: add a built-in IExternalCustomizationItemProvider to the CLI harness in SessionsCustomizationHarnessService that wraps IPromptsService directly. This uses the same provider API path as core VS Code, keeping the architecture consistent. Also extends CustomizationHarnessServiceBase with Disposable so subclasses can register disposables via _register. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… Disposable Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* chat: remove providerApi.enabled setting and legacy code paths The provider API is now permanently enabled. Remove the chat.customizations.providerApi.enabled setting, the false-path conditional that registered built-in CLI/Claude harnesses in core, the entire fetchCoreItemsForSection legacy item-loading pipeline, and related dead code (filterItemsForCore, applyBuiltinGroupKeys, storageToIcon, findPluginUri, isBuiltin/extensionLabel properties, kill-switch listener in mainThreadChatAgents2). CLI harness code is preserved for the sessions window. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * sessions: fix chat customizations editor empty by adding built-in itemProvider After removing fetchCoreItemsForSection (the IPromptsService fallback path), the sessions CLI harness had no itemProvider, causing the management editor to return [] for all sections while sidebar counts remained correct. Fix: add a built-in IExternalCustomizationItemProvider to the CLI harness in SessionsCustomizationHarnessService that wraps IPromptsService directly. This uses the same provider API path as core VS Code, keeping the architecture consistent. Also extends CustomizationHarnessServiceBase with Disposable so subclasses can register disposables via _register. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: dispose CustomizationHarnessServiceBase in tests after extending Disposable Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tions The cherry-picked PR (#308341) removed the promptsService-based core discovery path from the AI Customizations list widget, leaving only the provider-based path. The Local (VSCode) harness had no itemProvider, causing empty pages since no extension registers a provider for type 'vscode'. Add a built-in itemProvider wrapping IPromptsService to the core CustomizationHarnessService, matching the pattern already used by the Sessions CLI harness.
…tions The cherry-picked PR (#308341) removed the promptsService-based core discovery path from the AI Customizations list widget, leaving only the provider-based path. The Local (VSCode) harness had no itemProvider, causing empty pages since no extension registers a provider for type 'vscode'. Add a built-in itemProvider wrapping IPromptsService to the core CustomizationHarnessService, matching the pattern already used by the Sessions CLI harness.
…tions The cherry-picked PR (#308341) removed the promptsService-based core discovery path from the AI Customizations list widget, leaving only the provider-based path. The Local (VSCode) harness had no itemProvider, causing empty pages since no extension registers a provider for type 'vscode'. Add a built-in itemProvider wrapping IPromptsService to the core CustomizationHarnessService, matching the pattern already used by the Sessions CLI harness.
…tions The cherry-picked PR (#308341) removed the promptsService-based core discovery path from the AI Customizations list widget, leaving only the provider-based path. The Local (VSCode) harness had no itemProvider, causing empty pages since no extension registers a provider for type 'vscode'. Add a built-in itemProvider wrapping IPromptsService to the core CustomizationHarnessService, matching the pattern already used by the Sessions CLI harness.
…tions The cherry-picked PR (#308341) removed the promptsService-based core discovery path from the AI Customizations list widget, leaving only the provider-based path. The Local (VSCode) harness had no itemProvider, causing empty pages since no extension registers a provider for type 'vscode'. Add a built-in itemProvider wrapping IPromptsService to the core CustomizationHarnessService, matching the pattern already used by the Sessions CLI harness.
Summary
The provider API is now permanently enabled. This PR removes the
chat.customizations.providerApi.enabledsetting and all associated dead code paths (616 lines removed across 8 files).What was removed
constants.tsCustomizationsProviderApienum valuechat.contribution.tsharnessSelector.enableddescriptionbrowser/customizationHarnessService.tsIPathService/IConfigurationServicedeps.common/customizationHarnessService.tsClaudeenum value,getClaudeUserRoots(),createClaudeHarnessDescriptor()aiCustomizationListWidget.tsfetchCoreItemsForSection,applyBuiltinGroupKeys,storageToIcon,findPluginUri,filterItemsForCore,isBuiltin/extensionLabelinterface properties and all read sitesmainThreadChatAgents2.tsIConfigurationServicedepaiCustomizationManagementEditor.fixture.tsAI_CUSTOMIZATIONS.mdWhat was preserved
common/customizationHarnessService.ts— still used by the sessions (agents) window viaSessionsCustomizationHarnessServiceHOOKS_FILTER,createRestrictedHarnessDescriptor,createCliHarnessDescriptor,getCliUserRoots— all still live via sessions windowisChatExtensionItem— still used in the provider path for_inferStorageAndGroupmatchesWorkspaceSubpath/matchesInstructionFileFilter— still used by editor and creator serviceValidation
npm run compile-check-ts-native)