chat: remove Troubleshoot button from AI Customizations UI

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Josh Spicer
2026-04-27 11:10:07 -07:00
parent 9e867fda3b
commit 75a40d8b2a
3 changed files with 2 additions and 65 deletions

View File

@@ -20,7 +20,7 @@ import { IListVirtualDelegate, IListRenderer, IListContextMenuEvent } from '../.
import { IPromptsService, PromptsStorage } from '../../common/promptSyntax/service/promptsService.js';
import { PromptsType } from '../../common/promptSyntax/promptTypes.js';
import { agentIcon, instructionsIcon, promptIcon, skillIcon, hookIcon, userIcon, workspaceIcon, extensionIcon, pluginIcon, builtinIcon } from './aiCustomizationIcons.js';
import { AI_CUSTOMIZATION_ITEM_STORAGE_KEY, AI_CUSTOMIZATION_ITEM_TYPE_KEY, AI_CUSTOMIZATION_ITEM_URI_KEY, AI_CUSTOMIZATION_ITEM_PLUGIN_URI_KEY, AICustomizationManagementItemMenuId, AICustomizationManagementCreateMenuId, AICustomizationManagementSection, BUILTIN_STORAGE, AI_CUSTOMIZATION_ITEM_DISABLED_KEY, AI_CUSTOMIZATION_SUPPORTS_TROUBLESHOOT_KEY, sectionToPromptType } from './aiCustomizationManagement.js';
import { AI_CUSTOMIZATION_ITEM_STORAGE_KEY, AI_CUSTOMIZATION_ITEM_TYPE_KEY, AI_CUSTOMIZATION_ITEM_URI_KEY, AI_CUSTOMIZATION_ITEM_PLUGIN_URI_KEY, AICustomizationManagementItemMenuId, AICustomizationManagementCreateMenuId, AICustomizationManagementSection, BUILTIN_STORAGE, AI_CUSTOMIZATION_ITEM_DISABLED_KEY, sectionToPromptType } from './aiCustomizationManagement.js';
import { IAgentPluginService } from '../../common/plugins/agentPluginService.js';
import { InputBox } from '../../../../../base/browser/ui/inputbox/inputBox.js';
import { defaultButtonStyles, defaultInputBoxStyles } from '../../../../../platform/theme/browser/defaultStyles.js';
@@ -409,7 +409,6 @@ class AICustomizationItemRenderer implements IListRenderer<IFileItemEntry, IAICu
[AI_CUSTOMIZATION_ITEM_TYPE_KEY, element.promptType],
[AI_CUSTOMIZATION_ITEM_URI_KEY, element.uri.toString()],
[AI_CUSTOMIZATION_ITEM_DISABLED_KEY, element.disabled],
[AI_CUSTOMIZATION_SUPPORTS_TROUBLESHOOT_KEY, this.harnessService.getActiveDescriptor().supportsTroubleshoot ?? false],
];
if (element.storage) {
overlayPairs.push([AI_CUSTOMIZATION_ITEM_STORAGE_KEY, element.storage]);
@@ -708,7 +707,6 @@ export class AICustomizationListWidget extends Disposable {
[AI_CUSTOMIZATION_ITEM_TYPE_KEY, item.promptType],
[AI_CUSTOMIZATION_ITEM_URI_KEY, item.uri.toString()],
[AI_CUSTOMIZATION_ITEM_DISABLED_KEY, item.disabled],
[AI_CUSTOMIZATION_SUPPORTS_TROUBLESHOOT_KEY, this.harnessService.getActiveDescriptor().supportsTroubleshoot ?? false],
];
if (item.storage) {
overlayPairs.push([AI_CUSTOMIZATION_ITEM_STORAGE_KEY, item.storage]);

View File

@@ -27,7 +27,7 @@ import { Registry } from '../../../../../platform/registry/common/platform.js';
import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js';
import { EditorPaneDescriptor, IEditorPaneRegistry } from '../../../../browser/editor.js';
import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../../../common/contributions.js';
import { EditorExtensions, EditorsOrder, IEditorFactoryRegistry, IEditorSerializer } from '../../../../common/editor.js';
import { EditorExtensions, IEditorFactoryRegistry, IEditorSerializer } from '../../../../common/editor.js';
import { EditorInput } from '../../../../common/editor/editorInput.js';
import { IEditorService } from '../../../../services/editor/common/editorService.js';
import { ChatContextKeys } from '../../common/actions/chatContextKeys.js';
@@ -47,7 +47,6 @@ import {
AI_CUSTOMIZATION_ITEM_URI_KEY,
AI_CUSTOMIZATION_MANAGEMENT_EDITOR_ID,
AI_CUSTOMIZATION_MANAGEMENT_EDITOR_INPUT_ID,
AI_CUSTOMIZATION_SUPPORTS_TROUBLESHOOT_KEY,
AICustomizationManagementCommands,
AICustomizationManagementItemMenuId,
AICustomizationManagementSection,
@@ -176,15 +175,6 @@ function extractPluginUri(context: AICustomizationContext): URI | undefined {
return URI.isUri(raw) ? raw : typeof raw === 'string' ? URI.parse(raw) : undefined;
}
/**
* Extracts the item name from context.
*/
function extractName(context: AICustomizationContext): string | undefined {
if (URI.isUri(context) || typeof context === 'string') {
return undefined;
}
return typeof context.name === 'string' ? context.name : undefined;
}
/**
* Extracts the item ID from context (used for identifying individual hooks within a file).
@@ -259,39 +249,6 @@ registerAction2(class extends Action2 {
}
});
// Troubleshoot customization action
const TROUBLESHOOT_AI_CUSTOMIZATION_ID = 'aiCustomizationManagement.troubleshoot';
registerAction2(class extends Action2 {
constructor() {
super({
id: TROUBLESHOOT_AI_CUSTOMIZATION_ID,
title: localize2('troubleshoot', "Troubleshoot"),
icon: Codicon.bug,
});
}
async run(accessor: ServicesAccessor, context: AICustomizationContext): Promise<void> {
const commandService = accessor.get(ICommandService);
const editorService = accessor.get(IEditorService);
const rawName = extractName(context);
const displayName = rawName?.replace(/\.md$/i, '');
const query = displayName
? `/troubleshoot ${displayName}`
: '/troubleshoot';
// Close any open Agent Customizations editors before sending the chat.
const customizationEditors = editorService.getEditors(EditorsOrder.SEQUENTIAL)
.filter(({ editor }) => editor instanceof AICustomizationManagementEditorInput);
if (customizationEditors.length) {
await editorService.closeEditors(customizationEditors);
}
await commandService.executeCommand('workbench.action.chat.open', {
query,
isPartialQuery: false,
});
}
});
// Reveal in Finder/Explorer action
const REVEAL_IN_OS_LABEL = isWindows
? localize2('revealInWindows', "Reveal in File Explorer")
@@ -492,13 +449,6 @@ MenuRegistry.appendMenuItem(AICustomizationManagementItemMenuId, {
when: WHEN_ITEM_IS_DELETABLE,
});
MenuRegistry.appendMenuItem(AICustomizationManagementItemMenuId, {
command: { id: TROUBLESHOOT_AI_CUSTOMIZATION_ID, title: localize('troubleshootInline', "Troubleshoot"), icon: Codicon.bug },
group: 'inline',
order: 2,
when: ContextKeyExpr.equals(AI_CUSTOMIZATION_SUPPORTS_TROUBLESHOOT_KEY, true),
});
// Context menu items (shown on right-click)
MenuRegistry.appendMenuItem(AICustomizationManagementItemMenuId, {
command: { id: OPEN_AI_CUSTOMIZATION_MGMT_FILE_ID, title: localize('open', "Open") },
@@ -513,13 +463,6 @@ MenuRegistry.appendMenuItem(AICustomizationManagementItemMenuId, {
when: ContextKeyExpr.equals(AI_CUSTOMIZATION_ITEM_TYPE_KEY, PromptsType.prompt),
});
MenuRegistry.appendMenuItem(AICustomizationManagementItemMenuId, {
command: { id: TROUBLESHOOT_AI_CUSTOMIZATION_ID, title: localize('troubleshootItem', "Troubleshoot") },
group: '2_run',
order: 2,
when: ContextKeyExpr.equals(AI_CUSTOMIZATION_SUPPORTS_TROUBLESHOOT_KEY, true),
});
MenuRegistry.appendMenuItem(AICustomizationManagementItemMenuId, {
command: { id: REVEAL_AI_CUSTOMIZATION_IN_OS_ID, title: REVEAL_IN_OS_LABEL.value },
group: '3_file',

View File

@@ -123,10 +123,6 @@ export const AI_CUSTOMIZATION_ITEM_PLUGIN_URI_KEY = 'aiCustomizationManagementIt
*/
export const AI_CUSTOMIZATION_ITEM_DISABLED_KEY = 'aiCustomizationManagementItemDisabled';
/**
* Context key indicating whether the active harness supports troubleshooting.
*/
export const AI_CUSTOMIZATION_SUPPORTS_TROUBLESHOOT_KEY = 'aiCustomizationManagementSupportsTroubleshoot';
/**
* Storage key for persisting the selected section.