@@ -81,7 +81,10 @@ import { ClearCacheService } from './common/services/CacheService';
8181import { InMemory , Persisted } from './common/constants/general' ;
8282import { GitAPI , GitExtension , Repository } from './common/git' ;
8383import { AnalyticsSender } from './common/analytics/AnalyticsSender' ;
84- import { MEMENTO_ANALYTICS_PLUGIN_INSTALLED_SENT } from './common/constants/globalState' ;
84+ import {
85+ MEMENTO_ANALYTICS_PLUGIN_INSTALLED_SENT ,
86+ MEMENTO_SECURE_AT_INCEPTION_MODAL ,
87+ } from './common/constants/globalState' ;
8588import { AnalyticsEvent } from './common/analytics/AnalyticsEvent' ;
8689import { SummaryWebviewViewProvider } from './common/views/summaryWebviewProvider' ;
8790import { SummaryProviderService } from './base/summary/summaryProviderService' ;
@@ -487,20 +490,26 @@ class SnykExtension extends SnykLib implements IExtension {
487490 void extensionContext . updateGlobalStateValue ( MEMENTO_ANALYTICS_PLUGIN_INSTALLED_SENT , true ) ;
488491 } ) ;
489492
490- const options = [ 'Yes' ] as const ;
491- const picked = await vscode . window . showInformationMessage (
492- 'Do you want to enable Snyk to automatically scan and secure AI generated code?' ,
493- {
494- modal : true ,
495- detail :
496- ' Consider enabling this if you’re using an AI agent in your IDE. You can customize the scan frequency on Snyk Security’s settings page.' ,
497- } ,
498- ...options ,
499- ) ;
500-
501- if ( picked ) {
502- await configuration . setAutoConfigureMcpServer ( true ) ;
503- await configuration . setSecureAtInceptionExecutionFrequency ( 'On Code Generation' ) ;
493+ const secureAtInceptionModal =
494+ extensionContext . getGlobalStateValue < boolean > ( MEMENTO_SECURE_AT_INCEPTION_MODAL ) ?? false ;
495+
496+ if ( ! secureAtInceptionModal ) {
497+ await extensionContext . updateGlobalStateValue ( MEMENTO_SECURE_AT_INCEPTION_MODAL , true ) ;
498+ const options = [ 'Yes' ] as const ;
499+ const picked = await vscode . window . showInformationMessage (
500+ 'Do you want to enable Snyk to automatically scan and secure AI generated code?' ,
501+ {
502+ modal : true ,
503+ detail :
504+ ' Consider enabling this if you’re using an AI agent in your IDE. You can customize the scan frequency on Snyk Security’s settings page.' ,
505+ } ,
506+ ...options ,
507+ ) ;
508+
509+ if ( picked ) {
510+ await configuration . setAutoConfigureMcpServer ( true ) ;
511+ await configuration . setSecureAtInceptionExecutionFrequency ( 'On Code Generation' ) ;
512+ }
504513 }
505514 }
506515 }
0 commit comments