diff options
Diffstat (limited to 'packages/cli/src/config/settings.ts')
| -rw-r--r-- | packages/cli/src/config/settings.ts | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/cli/src/config/settings.ts b/packages/cli/src/config/settings.ts index 64500845..8005ad65 100644 --- a/packages/cli/src/config/settings.ts +++ b/packages/cli/src/config/settings.ts @@ -13,6 +13,7 @@ import { GEMINI_CONFIG_DIR as GEMINI_DIR, getErrorMessage, BugCommandSettings, + ChatCompressionSettings, TelemetrySettings, AuthType, } from '@google/gemini-cli-core'; @@ -134,6 +135,8 @@ export interface Settings { includeDirectories?: string[]; loadMemoryFromIncludeDirectories?: boolean; + + chatCompression?: ChatCompressionSettings; } export interface SettingsError { @@ -194,6 +197,11 @@ export class LoadedSettings { ...(user.includeDirectories || []), ...(workspace.includeDirectories || []), ], + chatCompression: { + ...(system.chatCompression || {}), + ...(user.chatCompression || {}), + ...(workspace.chatCompression || {}), + }, }; } @@ -482,6 +490,19 @@ export function loadSettings(workspaceDir: string): LoadedSettings { settingsErrors, ); + // Validate chatCompression settings + const chatCompression = loadedSettings.merged.chatCompression; + const threshold = chatCompression?.contextPercentageThreshold; + if ( + threshold != null && + (typeof threshold !== 'number' || threshold < 0 || threshold > 1) + ) { + console.warn( + `Invalid value for chatCompression.contextPercentageThreshold: "${threshold}". Please use a value between 0 and 1. Using default compression settings.`, + ); + delete loadedSettings.merged.chatCompression; + } + // Load environment with merged settings loadEnvironment(loadedSettings.merged); |
