chat - make signInWithAlternateScopes default (#280355)

This commit is contained in:
Benjamin Pasero 2025-12-01 18:05:18 +01:00 committed by GitHub
parent bc0c55891c
commit 23c5c4d1cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 23 deletions

View File

@ -116,17 +116,17 @@
},
"providerUriSetting": "github-enterprise.uri",
"providerScopes": [
[
"user:email"
],
[
"read:user"
],
[
"read:user",
"user:email",
"repo",
"workflow"
],
[
"user:email"
],
[
"read:user"
]
],
"entitlementUrl": "https://api.github.com/copilot_internal/user",

View File

@ -791,15 +791,6 @@ configurationRegistry.registerConfiguration({
mode: 'auto'
}
},
'chat.signInWithAlternateScopes': { // TODO@bpasero remove me eventually
type: 'boolean',
description: nls.localize('chat.signInWithAlternateScopes', "Controls whether sign-in with alternate scopes is used."),
default: false,
tags: ['experimental'],
experiment: {
mode: 'auto'
}
},
'chat.extensionUnification.enabled': {
type: 'boolean',
description: nls.localize('chat.extensionUnification.enabled', "Enables the unification of GitHub Copilot extensions. When enabled, all GitHub Copilot functionality is served from the GitHub Copilot Chat extension. When disabled, the GitHub Copilot and GitHub Copilot Chat extensions operate independently."),

View File

@ -1056,14 +1056,7 @@ export class ChatEntitlementRequests extends Disposable {
async signIn(options?: { useSocialProvider?: string; additionalScopes?: readonly string[] }) {
const providerId = ChatEntitlementRequests.providerId(this.configurationService);
let defaultProviderScopes: string[];
if (this.configurationService.getValue<unknown>('chat.signInWithAlternateScopes') === true) {
defaultProviderScopes = defaultChat.providerScopes.at(-1) ?? [];
} else {
defaultProviderScopes = defaultChat.providerScopes.at(0) ?? [];
}
const scopes = options?.additionalScopes ? distinct([...defaultProviderScopes, ...options.additionalScopes]) : defaultProviderScopes;
const scopes = options?.additionalScopes ? distinct([...defaultChat.providerScopes[0], ...options.additionalScopes]) : defaultChat.providerScopes[0];
const session = await this.authenticationService.createSession(
providerId,
scopes,