From f773bc3024f1e086c955d723134d8d180f983b64 Mon Sep 17 00:00:00 2001 From: Diarmid Mackenzie Date: Tue, 25 Mar 2025 19:31:29 +0000 Subject: [PATCH] Remove "Enable Custom Mode Creation Through Prompts" toggle (#1980) * Remove custom mode creation option * Remove redundant code branch --- src/core/prompts/sections/modes.ts | 8 +--- src/core/webview/ClineProvider.ts | 4 -- src/exports/roo-code.d.ts | 1 - src/shared/ExtensionMessage.ts | 1 - src/shared/WebviewMessage.ts | 1 - src/shared/globalState.ts | 1 - .../src/components/prompts/PromptsView.tsx | 39 ------------------- .../src/context/ExtensionStateContext.tsx | 5 --- webview-ui/src/i18n/locales/ca/prompts.json | 4 -- webview-ui/src/i18n/locales/de/prompts.json | 4 -- webview-ui/src/i18n/locales/en/prompts.json | 4 -- webview-ui/src/i18n/locales/es/prompts.json | 4 -- webview-ui/src/i18n/locales/fr/prompts.json | 4 -- webview-ui/src/i18n/locales/hi/prompts.json | 4 -- webview-ui/src/i18n/locales/it/prompts.json | 4 -- webview-ui/src/i18n/locales/ja/prompts.json | 4 -- webview-ui/src/i18n/locales/ko/prompts.json | 4 -- webview-ui/src/i18n/locales/pl/prompts.json | 4 -- .../src/i18n/locales/pt-BR/prompts.json | 4 -- webview-ui/src/i18n/locales/tr/prompts.json | 4 -- webview-ui/src/i18n/locales/vi/prompts.json | 4 -- .../src/i18n/locales/zh-CN/prompts.json | 4 -- .../src/i18n/locales/zh-TW/prompts.json | 4 -- 23 files changed, 1 insertion(+), 119 deletions(-) diff --git a/src/core/prompts/sections/modes.ts b/src/core/prompts/sections/modes.ts index 12e90c4076..50c805dd5d 100644 --- a/src/core/prompts/sections/modes.ts +++ b/src/core/prompts/sections/modes.ts @@ -11,9 +11,6 @@ export async function getModesSection(context: vscode.ExtensionContext): Promise // Get all modes with their overrides from extension state const allModes = await getAllModesWithPrompts(context) - // Get enableCustomModeCreation setting from extension state - const shouldEnableCustomModeCreation = (await context.globalState.get("enableCustomModeCreation")) ?? true - let modesContent = `==== MODES @@ -21,15 +18,12 @@ MODES - These are the currently available modes: ${allModes.map((mode: ModeConfig) => ` * "${mode.name}" mode (${mode.slug}) - ${mode.roleDefinition.split(".")[0]}`).join("\n")}` - // Only include custom modes documentation if the feature is enabled - if (shouldEnableCustomModeCreation) { - modesContent += ` + modesContent += ` If the user asks you to create or edit a new mode for this project, you should read the instructions by using the fetch_instructions tool, like this: create_mode ` - } return modesContent } diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index b8d2c5d57e..addd020da2 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -1679,10 +1679,6 @@ export class ClineProvider extends EventEmitter implements await this.updateGlobalState("enhancementApiConfigId", message.text) await this.postStateToWebview() break - case "enableCustomModeCreation": - await this.updateGlobalState("enableCustomModeCreation", message.bool ?? true) - await this.postStateToWebview() - break case "autoApprovalEnabled": await this.updateGlobalState("autoApprovalEnabled", message.bool ?? false) await this.postStateToWebview() diff --git a/src/exports/roo-code.d.ts b/src/exports/roo-code.d.ts index fc02b51b73..ddbd8b2d40 100644 --- a/src/exports/roo-code.d.ts +++ b/src/exports/roo-code.d.ts @@ -240,7 +240,6 @@ export type GlobalStateKey = | "enhancementApiConfigId" | "experiments" // Map of experiment IDs to their enabled state | "autoApprovalEnabled" - | "enableCustomModeCreation" // Enable the ability for Roo to create custom modes | "customModes" // Array of custom modes | "unboundModelId" | "requestyModelId" diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 12553b7c61..f42381701a 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -153,7 +153,6 @@ export interface ExtensionState { terminalShellIntegrationTimeout?: number mcpEnabled: boolean enableMcpServerCreation: boolean - enableCustomModeCreation?: boolean mode: Mode modeApiConfigs?: Record enhancementApiConfigId?: string diff --git a/src/shared/WebviewMessage.ts b/src/shared/WebviewMessage.ts index 52411bca6f..7a4cb38c67 100644 --- a/src/shared/WebviewMessage.ts +++ b/src/shared/WebviewMessage.ts @@ -80,7 +80,6 @@ export interface WebviewMessage { | "terminalShellIntegrationTimeout" | "mcpEnabled" | "enableMcpServerCreation" - | "enableCustomModeCreation" | "searchCommits" | "alwaysApproveResubmit" | "requestDelaySeconds" diff --git a/src/shared/globalState.ts b/src/shared/globalState.ts index 73b46eff58..71d990906a 100644 --- a/src/shared/globalState.ts +++ b/src/shared/globalState.ts @@ -107,7 +107,6 @@ export const GLOBAL_STATE_KEYS = [ "enhancementApiConfigId", "experiments", // Map of experiment IDs to their enabled state. "autoApprovalEnabled", - "enableCustomModeCreation", // Enable the ability for Roo to create custom modes. "customModes", // Array of custom modes. "unboundModelId", "requestyModelId", diff --git a/webview-ui/src/components/prompts/PromptsView.tsx b/webview-ui/src/components/prompts/PromptsView.tsx index 4011e15950..d1b0a9d732 100644 --- a/webview-ui/src/components/prompts/PromptsView.tsx +++ b/webview-ui/src/components/prompts/PromptsView.tsx @@ -57,8 +57,6 @@ const PromptsView = ({ onDone }: PromptsViewProps) => { customInstructions, setCustomInstructions, customModes, - enableCustomModeCreation, - setEnableCustomModeCreation, } = useExtensionState() // Memoize modes to preserve array order @@ -326,17 +324,6 @@ const PromptsView = ({ onDone }: PromptsViewProps) => { return () => document.removeEventListener("click", handleClickOutside) }, [showConfigMenu]) - // Add effect to sync enableCustomModeCreation with backend - useEffect(() => { - if (enableCustomModeCreation !== undefined) { - // Send the value to the extension's global state - vscode.postMessage({ - type: "enableCustomModeCreation", // Using dedicated message type - bool: enableCustomModeCreation, - }) - } - }, [enableCustomModeCreation]) - useEffect(() => { const handler = (event: MessageEvent) => { const message = event.data @@ -857,32 +844,6 @@ const PromptsView = ({ onDone }: PromptsViewProps) => { - {/* - NOTE: This setting is placed in PromptsView rather than SettingsView since it - directly affects the functionality related to modes and custom mode creation, - which are managed in this component. This is an intentional deviation from - the standard pattern described in cline_docs/settings.md. - */} -
- { - // Just update the local state through React context - // The React context will update the global state - setEnableCustomModeCreation(e.target.checked) - }}> - {t("prompts:customModeCreation.enableTitle")} - -

- {t("prompts:customModeCreation.description")} -

-
- {/* Custom System Prompt Disclosure */}