diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 1e2e309359..840a5ab7b1 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -564,10 +564,16 @@ export class ClineProvider implements vscode.WebviewViewProvider { await this.updateGlobalState("lmStudioModelId", newModelId) break } + + if (this.cline) { + const { apiConfiguration: updatedApiConfiguration } = await this.getState() + this.cline.api = buildApiHandler(updatedApiConfiguration) + } } await this.updateGlobalState("chatSettings", message.chatSettings) await this.postStateToWebview() + // console.log("chatSettings", message.chatSettings) if (this.cline) { this.cline.updateChatSettings(message.chatSettings) if (this.cline.isAwaitingPlanResponse && didSwitchToActMode) { diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index c7183bd464..c66837a251 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -597,7 +597,7 @@ const ChatTextArea = forwardRef( }, [apiConfiguration, openRouterModels]) const onModeToggle = useCallback(() => { - if (textAreaDisabled) return + // if (textAreaDisabled) return let changeModeDelay = 0 if (showModelSelector) { // user has model selector open, so we should save it before switching modes @@ -617,7 +617,7 @@ const ChatTextArea = forwardRef( textAreaRef.current?.focus() }, 100) }, changeModeDelay) - }, [chatSettings.mode, textAreaDisabled, showModelSelector, submitApiConfig]) + }, [chatSettings.mode, showModelSelector, submitApiConfig]) const handleContextButtonClick = useCallback(() => { if (textAreaDisabled) return @@ -1038,7 +1038,7 @@ const ChatTextArea = forwardRef( { // if (e.key === "Enter" || e.key === " ") { @@ -1068,7 +1068,7 @@ const ChatTextArea = forwardRef( - + Plan Act