diff --git a/packages/ai-core/src/browser/ai-activation-service.ts b/packages/ai-core/src/browser/ai-activation-service.ts index a914604306995..f28b1dceeac04 100644 --- a/packages/ai-core/src/browser/ai-activation-service.ts +++ b/packages/ai-core/src/browser/ai-activation-service.ts @@ -45,7 +45,8 @@ export class AIActivationService implements FrontendApplicationContribution { } initialize(): MaybePromise { - this.isAiEnabledKey = this.contextKeyService.createKey(ENABLE_AI_CONTEXT_KEY, false); + const value = this.preferenceService.get(ENABLE_AI_CONTEXT_KEY); + this.isAiEnabledKey = this.contextKeyService.createKey(ENABLE_AI_CONTEXT_KEY, value); this.preferenceService.onPreferenceChanged(e => { if (e.preferenceName === PREFERENCE_NAME_ENABLE_AI) { this.isAiEnabledKey.set(e.newValue);