mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-25 20:44:46 -07:00
feat(context): add remote configuration for tool output masking thresholds (#18553)
This commit is contained in:
@@ -1433,8 +1433,39 @@ export class Config {
|
||||
return this.toolOutputMasking.enabled;
|
||||
}
|
||||
|
||||
getToolOutputMaskingConfig(): ToolOutputMaskingConfig {
|
||||
return this.toolOutputMasking;
|
||||
async getToolOutputMaskingConfig(): Promise<ToolOutputMaskingConfig> {
|
||||
await this.ensureExperimentsLoaded();
|
||||
|
||||
const remoteProtection =
|
||||
this.experiments?.flags[ExperimentFlags.MASKING_PROTECTION_THRESHOLD]
|
||||
?.intValue;
|
||||
const remotePrunable =
|
||||
this.experiments?.flags[ExperimentFlags.MASKING_PRUNABLE_THRESHOLD]
|
||||
?.intValue;
|
||||
const remoteProtectLatest =
|
||||
this.experiments?.flags[ExperimentFlags.MASKING_PROTECT_LATEST_TURN]
|
||||
?.boolValue;
|
||||
|
||||
const parsedProtection = remoteProtection
|
||||
? parseInt(remoteProtection, 10)
|
||||
: undefined;
|
||||
const parsedPrunable = remotePrunable
|
||||
? parseInt(remotePrunable, 10)
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
enabled: this.toolOutputMasking.enabled,
|
||||
toolProtectionThreshold:
|
||||
parsedProtection !== undefined && !isNaN(parsedProtection)
|
||||
? parsedProtection
|
||||
: this.toolOutputMasking.toolProtectionThreshold,
|
||||
minPrunableTokensThreshold:
|
||||
parsedPrunable !== undefined && !isNaN(parsedPrunable)
|
||||
? parsedPrunable
|
||||
: this.toolOutputMasking.minPrunableTokensThreshold,
|
||||
protectLatestTurn:
|
||||
remoteProtectLatest ?? this.toolOutputMasking.protectLatestTurn,
|
||||
};
|
||||
}
|
||||
|
||||
getGeminiMdFileCount(): number {
|
||||
|
||||
Reference in New Issue
Block a user