From 0d25faab009f224ad2a7ec622ef4a56840ce10b6 Mon Sep 17 00:00:00 2001 From: imranshaiedi-byte Date: Tue, 20 Jan 2026 22:33:15 +0800 Subject: [PATCH 1/2] reasoningleveldropdown --- .../src/components/chat/ChatTextArea.tsx | 3 + .../chat/ReasoningEffortDropdown.tsx | 95 +++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 webview-ui/src/components/chat/ReasoningEffortDropdown.tsx diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index 654f2e1011e..2c88135e982 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -28,6 +28,7 @@ import Thumbnails from "../common/Thumbnails" import { ModeSelector } from "./ModeSelector" import { ApiConfigSelector } from "./ApiConfigSelector" import { AutoApproveDropdown } from "./AutoApproveDropdown" +import ReasoningEffortDropdown from "./ReasoningEffortDropdown" import { MAX_IMAGES_PER_MESSAGE } from "./ChatView" import ContextMenu from "./ContextMenu" import { IndexingStatusBadge } from "./IndexingStatusBadge" @@ -103,6 +104,7 @@ export const ChatTextArea = forwardRef( commands, cloudUserInfo, enterBehavior, + apiConfiguration, } = useExtensionState() // Find the ID and display text for the currently selected API configuration. @@ -1317,6 +1319,7 @@ export const ChatTextArea = forwardRef( pinnedApiConfigs={pinnedApiConfigs} togglePinnedApiConfig={togglePinnedApiConfig} /> +
{ + const { t } = useAppTranslation() + const { info: model } = useSelectedModel(apiConfiguration) + + // Check if model supports reasoning effort + const isReasoningEffortSupported = !!model && model.supportsReasoningEffort + + // Check if reasoning is enabled + const isReasoningEnabled = apiConfiguration?.enableReasoningEffort === true + + // Get current reasoning effort value + const currentReasoningEffort = apiConfiguration?.reasoningEffort + + // Build available options based on model capabilities + const availableOptions: readonly ReasoningEffortWithMinimal[] = isReasoningEffortSupported + ? (model?.reasoningEfforts as readonly ReasoningEffortWithMinimal[]) || [ + "low" as const, + "medium" as const, + "high" as const, + ]) + : [] + + // Determine if we should show the dropdown + const shouldShowDropdown = isReasoningEffortSupported && isReasoningEnabled + + // Get display value for current selection + const getDisplayValue = (value: ReasoningEffortWithMinimal | undefined) => { + if (value === "disable" || value === "none") { + return t("settings:providers.reasoningEffort.none") + } + return t(`settings:providers.reasoningEffort.${value}`) + } + + const handleValueChange = (value: ReasoningEffortWithMinimal) => { + // Send message to update reasoning effort + // This will be handled by the extension to persist to the current profile + const message = { + type: "upsertApiConfiguration", + text: "", // Will use current config name from extension + apiConfiguration: { + reasoningEffort: value, + enableReasoningEffort: true, + }, + } + if (typeof vscode !== "undefined") { + vscode.postMessage(message) + } + } + + if (!shouldShowDropdown) { + return null + } + + return ( + + + + ) +} + +export default memo(ReasoningEffortDropdown) From a8e1e683e36ae740c9687db808de9cb45458c5e5 Mon Sep 17 00:00:00 2001 From: imranshaiedi-byte Date: Tue, 20 Jan 2026 22:41:59 +0800 Subject: [PATCH 2/2] Revert 'reasoningleveldropdown' --- .../src/components/chat/ChatTextArea.tsx | 3 - .../chat/ReasoningEffortDropdown.tsx | 95 ------------------- 2 files changed, 98 deletions(-) delete mode 100644 webview-ui/src/components/chat/ReasoningEffortDropdown.tsx diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index 2c88135e982..654f2e1011e 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -28,7 +28,6 @@ import Thumbnails from "../common/Thumbnails" import { ModeSelector } from "./ModeSelector" import { ApiConfigSelector } from "./ApiConfigSelector" import { AutoApproveDropdown } from "./AutoApproveDropdown" -import ReasoningEffortDropdown from "./ReasoningEffortDropdown" import { MAX_IMAGES_PER_MESSAGE } from "./ChatView" import ContextMenu from "./ContextMenu" import { IndexingStatusBadge } from "./IndexingStatusBadge" @@ -104,7 +103,6 @@ export const ChatTextArea = forwardRef( commands, cloudUserInfo, enterBehavior, - apiConfiguration, } = useExtensionState() // Find the ID and display text for the currently selected API configuration. @@ -1319,7 +1317,6 @@ export const ChatTextArea = forwardRef( pinnedApiConfigs={pinnedApiConfigs} togglePinnedApiConfig={togglePinnedApiConfig} /> -
{ - const { t } = useAppTranslation() - const { info: model } = useSelectedModel(apiConfiguration) - - // Check if model supports reasoning effort - const isReasoningEffortSupported = !!model && model.supportsReasoningEffort - - // Check if reasoning is enabled - const isReasoningEnabled = apiConfiguration?.enableReasoningEffort === true - - // Get current reasoning effort value - const currentReasoningEffort = apiConfiguration?.reasoningEffort - - // Build available options based on model capabilities - const availableOptions: readonly ReasoningEffortWithMinimal[] = isReasoningEffortSupported - ? (model?.reasoningEfforts as readonly ReasoningEffortWithMinimal[]) || [ - "low" as const, - "medium" as const, - "high" as const, - ]) - : [] - - // Determine if we should show the dropdown - const shouldShowDropdown = isReasoningEffortSupported && isReasoningEnabled - - // Get display value for current selection - const getDisplayValue = (value: ReasoningEffortWithMinimal | undefined) => { - if (value === "disable" || value === "none") { - return t("settings:providers.reasoningEffort.none") - } - return t(`settings:providers.reasoningEffort.${value}`) - } - - const handleValueChange = (value: ReasoningEffortWithMinimal) => { - // Send message to update reasoning effort - // This will be handled by the extension to persist to the current profile - const message = { - type: "upsertApiConfiguration", - text: "", // Will use current config name from extension - apiConfiguration: { - reasoningEffort: value, - enableReasoningEffort: true, - }, - } - if (typeof vscode !== "undefined") { - vscode.postMessage(message) - } - } - - if (!shouldShowDropdown) { - return null - } - - return ( - - - - ) -} - -export default memo(ReasoningEffortDropdown)