diff options
| author | Jerop Kipruto <[email protected]> | 2025-06-23 20:29:31 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-24 00:29:31 +0000 |
| commit | aca034fdfec0ec29bdb47c5feaa4eafd6e68fac7 (patch) | |
| tree | 137496d8b1d3394e6ceeb7ccdd8e06ccdef301e8 /packages/core/src | |
| parent | b3741f7016a6b32ebdc5a9b5203191fc04910d3a (diff) | |
Refactor usage statistics to be a top-level setting (#1363)
This commit refactors the `usageStatisticsEnabled` setting from a sub-property of the `telemetry` configuration to a top-level setting. This change simplifies the configuration by decoupling usage statistics from the telemetry settings.
The documentation has also been updated to reflect this change.
Diffstat (limited to 'packages/core/src')
| -rw-r--r-- | packages/core/src/config/config.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index 65d69a41..a92dd7ba 100644 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -57,7 +57,6 @@ export interface TelemetrySettings { target?: TelemetryTarget; otlpEndpoint?: string; logPrompts?: boolean; - usageStatisticsEnabled?: boolean; } export class MCPServerConfig { @@ -107,6 +106,7 @@ export interface ConfigParameters { contextFileName?: string | string[]; accessibility?: AccessibilitySettings; telemetry?: TelemetrySettings; + usageStatisticsEnabled?: boolean; fileFiltering?: { respectGitIgnore?: boolean; enableRecursiveFileSearch?: boolean; @@ -142,6 +142,7 @@ export class Config { private readonly showMemoryUsage: boolean; private readonly accessibility: AccessibilitySettings; private readonly telemetrySettings: TelemetrySettings; + private readonly usageStatisticsEnabled: boolean; private geminiClient!: GeminiClient; private readonly fileFiltering: { respectGitIgnore: boolean; @@ -181,8 +182,8 @@ export class Config { target: params.telemetry?.target ?? DEFAULT_TELEMETRY_TARGET, otlpEndpoint: params.telemetry?.otlpEndpoint ?? DEFAULT_OTLP_ENDPOINT, logPrompts: params.telemetry?.logPrompts ?? true, - usageStatisticsEnabled: params.telemetry?.usageStatisticsEnabled ?? true, }; + this.usageStatisticsEnabled = params.usageStatisticsEnabled ?? true; this.fileFiltering = { respectGitIgnore: params.fileFiltering?.respectGitIgnore ?? true, @@ -386,7 +387,7 @@ export class Config { } getUsageStatisticsEnabled(): boolean { - return this.telemetrySettings.usageStatisticsEnabled ?? true; + return this.usageStatisticsEnabled; } getExtensionContextFilePaths(): string[] { |
