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
This commit is contained in:
Ton Hoang Nguyen (Bill) 2025-06-26 19:08:38 +01:00
parent 26b1f53d9b
commit 8f468f49b0

View file

@ -177,6 +177,15 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ 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<SettingsViewRef, SettingsViewProps>(({ onDone, t
setApiConfigurationField={setApiConfigurationField}
errorMessage={errorMessage}
setErrorMessage={setErrorMessage}
currentProfileId={currentApiConfigName}
currentProfileId={getCurrentProfileId()}
profileThresholds={profileThresholds || {}}
autoCondenseContextPercent={autoCondenseContextPercent || 75}
setProfileThreshold={setProfileThreshold}