From 8f468f49b06ea43657056db971bf530732ee544c Mon Sep 17 00:00:00 2001 From: "Ton Hoang Nguyen (Bill)" <32552798+HahaBill@users.noreply.github.com> Date: Thu, 26 Jun 2025 19:08:38 +0100 Subject: [PATCH] feat: changing profile-specific threshold in context management setting will also change in Gemini context management - sync between Context Management Settting <-> Gemini Context Management with regards to thresholding --- webview-ui/src/components/settings/SettingsView.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index 99b1407d97..d1f2364a18 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -177,6 +177,15 @@ const SettingsView = forwardRef(({ onDone, t const apiConfiguration = useMemo(() => cachedState.apiConfiguration ?? {}, [cachedState.apiConfiguration]) + const getCurrentProfileId = useCallback(() => { + if (!currentApiConfigName || !listApiConfigMeta) { + return currentApiConfigName + } + + const profile = listApiConfigMeta.find((p) => p.name === currentApiConfigName) + return profile ? profile.id : currentApiConfigName + }, [currentApiConfigName, listApiConfigMeta]) + useEffect(() => { // Update only when currentApiConfigName is changed. // Expected to be triggered by loadApiConfiguration/upsertApiConfiguration. @@ -586,7 +595,7 @@ const SettingsView = forwardRef(({ onDone, t setApiConfigurationField={setApiConfigurationField} errorMessage={errorMessage} setErrorMessage={setErrorMessage} - currentProfileId={currentApiConfigName} + currentProfileId={getCurrentProfileId()} profileThresholds={profileThresholds || {}} autoCondenseContextPercent={autoCondenseContextPercent || 75} setProfileThreshold={setProfileThreshold}