Skip to content

Commit 8f468f4

Browse files
committed
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
1 parent 26b1f53 commit 8f468f4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

webview-ui/src/components/settings/SettingsView.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,15 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
177177

178178
const apiConfiguration = useMemo(() => cachedState.apiConfiguration ?? {}, [cachedState.apiConfiguration])
179179

180+
const getCurrentProfileId = useCallback(() => {
181+
if (!currentApiConfigName || !listApiConfigMeta) {
182+
return currentApiConfigName
183+
}
184+
185+
const profile = listApiConfigMeta.find((p) => p.name === currentApiConfigName)
186+
return profile ? profile.id : currentApiConfigName
187+
}, [currentApiConfigName, listApiConfigMeta])
188+
180189
useEffect(() => {
181190
// Update only when currentApiConfigName is changed.
182191
// Expected to be triggered by loadApiConfiguration/upsertApiConfiguration.
@@ -586,7 +595,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
586595
setApiConfigurationField={setApiConfigurationField}
587596
errorMessage={errorMessage}
588597
setErrorMessage={setErrorMessage}
589-
currentProfileId={currentApiConfigName}
598+
currentProfileId={getCurrentProfileId()}
590599
profileThresholds={profileThresholds || {}}
591600
autoCondenseContextPercent={autoCondenseContextPercent || 75}
592601
setProfileThreshold={setProfileThreshold}

0 commit comments

Comments
 (0)