@@ -45,6 +45,8 @@ import { IPreferencesService } from 'vs/workbench/services/preferences/common/pr
45
45
import { ILabelService } from 'vs/platform/label/common/label' ;
46
46
import { IProductService } from 'vs/platform/product/common/productService' ;
47
47
import { MANAGE_TRUST_COMMAND_ID , WorkspaceTrustContext } from 'vs/workbench/contrib/workspace/common/workspace' ;
48
+ import { isWeb } from 'vs/base/common/platform' ;
49
+ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
48
50
49
51
const BANNER_RESTRICTED_MODE = 'workbench.banner.restrictedMode' ;
50
52
const STARTUP_PROMPT_SHOWN_KEY = 'workspace.trust.startupPrompt.shown' ;
@@ -220,7 +222,8 @@ export class WorkspaceTrustUXHandler extends Disposable implements IWorkbenchCon
220
222
@IBannerService private readonly bannerService : IBannerService ,
221
223
@ILabelService private readonly labelService : ILabelService ,
222
224
@IHostService private readonly hostService : IHostService ,
223
- @IProductService private readonly productService : IProductService
225
+ @IProductService private readonly productService : IProductService ,
226
+ @IRemoteAgentService private readonly remoteAgentService : IRemoteAgentService ,
224
227
) {
225
228
super ( ) ;
226
229
@@ -490,7 +493,14 @@ export class WorkspaceTrustUXHandler extends Disposable implements IWorkbenchCon
490
493
491
494
492
495
private get bannerSetting ( ) : 'always' | 'untilDismissed' | 'never' {
493
- return this . configurationService . getValue ( WORKSPACE_TRUST_BANNER ) ;
496
+ const result = this . configurationService . getValue < 'always' | 'untilDismissed' | 'never' > ( WORKSPACE_TRUST_BANNER ) ;
497
+
498
+ // In serverless environments, we don't need to aggressively show the banner
499
+ if ( result !== 'always' && isWeb && ! this . remoteAgentService . getConnection ( ) ?. remoteAuthority ) {
500
+ return 'never' ;
501
+ }
502
+
503
+ return result ;
494
504
}
495
505
496
506
//#endregion
0 commit comments