Skip to content

Commit ed52e54

Browse files
authored
chat - add serverlessWebEnabled for testing web support
1 parent 28af0e9 commit ed52e54

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/vs/workbench/contrib/chat/common/chatContextKeys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export namespace ChatContextKeys {
3333
export const hasPromptFile = new RawContextKey<boolean>('chatPromptFileAttached', false, { type: 'boolean', description: localize('chatPromptFileAttachedContextDescription', "True when the chat has a prompt file attached.") });
3434
export const chatMode = new RawContextKey<ChatMode>('chatMode', ChatMode.Ask, { type: 'string', description: localize('chatMode', "The current chat mode.") });
3535

36-
export const supported = ContextKeyExpr.or(IsWebContext.negate(), RemoteNameContext.notEqualsTo('')); // supported on desktop and in web only with a remote connection
36+
export const supported = ContextKeyExpr.or(IsWebContext.negate(), RemoteNameContext.notEqualsTo(''), ContextKeyExpr.has('config.chat.experimental.serverlessWebEnabled'));
3737
export const enabled = new RawContextKey<boolean>('chatIsEnabled', false, { type: 'boolean', description: localize('chatIsEnabled', "True when chat is enabled because a default chat participant is activated with an implementation.") });
3838

3939
export const extensionParticipantRegistered = new RawContextKey<boolean>('chatPanelExtensionParticipantRegistered', false, { type: 'boolean', description: localize('chatPanelExtensionParticipantRegistered', "True when a default chat participant is registered for the panel from an extension.") });

src/vs/workbench/contrib/chat/common/chatEntitlementService.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export class ChatEntitlementService extends Disposable implements IChatEntitleme
147147
@IProductService productService: IProductService,
148148
@IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService,
149149
@IContextKeyService private readonly contextKeyService: IContextKeyService,
150+
@IConfigurationService configurationService: IConfigurationService
150151
) {
151152
super();
152153

@@ -179,7 +180,12 @@ export class ChatEntitlementService extends Disposable implements IChatEntitleme
179180

180181
if (
181182
!productService.defaultChatAgent || // needs product config
182-
(isWeb && !environmentService.remoteAuthority) // only enabled locally or a remote backend
183+
(
184+
// TODO@bpasero remove this condition and 'serverlessWebEnabled' once Chat web support lands
185+
isWeb &&
186+
!environmentService.remoteAuthority &&
187+
!configurationService.getValue('chat.experimental.serverlessWebEnabled')
188+
)
183189
) {
184190
ChatContextKeys.Setup.hidden.bindTo(this.contextKeyService).set(true); // hide copilot UI
185191
return;

0 commit comments

Comments
 (0)