Skip to content

Commit c03cd42

Browse files
authored
chat - towards experimental anonymous access (#265996)
1 parent 8e7ae9a commit c03cd42

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/vs/workbench/contrib/chat/browser/chat.contribution.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ configurationRegistry.registerConfiguration({
670670
},
671671
'chat.allowAnonymousAccess': { // TODO@bpasero remove me eventually
672672
type: 'boolean',
673+
description: nls.localize('chat.allowAnonymousAccess', "Controls whether anonymous access is allowed in chat."),
673674
default: false,
674675
tags: ['experimental'],
675676
experiment: {

src/vs/workbench/contrib/chat/browser/chatSetup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ class SetupAgent extends Disposable implements IChatAgentImplementation {
441441
let result: IChatSetupResult | undefined = undefined;
442442
try {
443443
result = await ChatSetup.getInstance(this.instantiationService, this.context, this.controller).run({
444-
disableChatViewReveal: true, // we are already in a chat context
445-
allowAnonymous: true, // in chat context we can allow anonymous usage (TODO@bpasero make this dependent on terms visibility)
444+
disableChatViewReveal: true, // we are already in a chat context
445+
allowAnonymous: this.location === ChatAgentLocation.Chat, // allow anonymous based on location (TODO@bpasero expand this to more locations)
446446
});
447447
} catch (error) {
448448
this.logService.error(`[chat setup] Error during setup: ${toErrorMessage(error)}`);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ export class ChatEntitlementContext extends Disposable {
10991099

11001100
if (this.configurationService.getValue(ChatEntitlementContext.CHAT_ALLOW_ANONYMOUS_CONFIGURATION_KEY) === true) {
11011101
let entitlement = state.entitlement;
1102-
if (entitlement === ChatEntitlement.Unknown /*&& !state.registered TODO@bpasero revisit */) {
1102+
if (entitlement === ChatEntitlement.Unknown && !state.registered) {
11031103
entitlement = ChatEntitlement.Anonymous; // enable `anonymous` based on exp config if entitlement is unknown and user never signed up
11041104
}
11051105

0 commit comments

Comments
 (0)