@@ -120,15 +120,16 @@ export class MainThreadChatProvider implements MainThreadChatProviderShape {
120120 return Disposable . None ;
121121 }
122122
123+ const accountLabel = auth . accountLabel ?? localize ( 'languageModelsAccountId' , 'Language Models' ) ;
123124 const disposables = new DisposableStore ( ) ;
124- this . _authenticationService . registerAuthenticationProvider ( authProviderId , new LanguageModelAccessAuthProvider ( authProviderId , auth . providerLabel , auth . accountLabel ) ) ;
125+ this . _authenticationService . registerAuthenticationProvider ( authProviderId , new LanguageModelAccessAuthProvider ( authProviderId , auth . providerLabel , accountLabel ) ) ;
125126 disposables . add ( toDisposable ( ( ) => {
126127 this . _authenticationService . unregisterAuthenticationProvider ( authProviderId ) ;
127128 } ) ) ;
128129 disposables . add ( this . _authenticationService . onDidChangeSessions ( async ( e ) => {
129130 if ( e . providerId === authProviderId ) {
130131 if ( e . event . removed ?. length ) {
131- const allowedExtensions = this . _authenticationService . readAllowedExtensions ( authProviderId , authProviderId ) ;
132+ const allowedExtensions = this . _authenticationService . readAllowedExtensions ( authProviderId , accountLabel ) ;
132133 const extensionsToUpdateAccess = [ ] ;
133134 for ( const allowed of allowedExtensions ) {
134135 const from = await this . _extensionService . getExtension ( allowed . id ) ;
@@ -146,7 +147,7 @@ export class MainThreadChatProvider implements MainThreadChatProviderShape {
146147 }
147148 } ) ) ;
148149 disposables . add ( this . _authenticationService . onDidChangeExtensionSessionAccess ( async ( e ) => {
149- const allowedExtensions = this . _authenticationService . readAllowedExtensions ( authProviderId , authProviderId ) ;
150+ const allowedExtensions = this . _authenticationService . readAllowedExtensions ( authProviderId , accountLabel ) ;
150151 const accessList = [ ] ;
151152 for ( const allowedExtension of allowedExtensions ) {
152153 const from = await this . _extensionService . getExtension ( allowedExtension . id ) ;
@@ -174,11 +175,7 @@ class LanguageModelAccessAuthProvider implements IAuthenticationProvider {
174175
175176 private _session : AuthenticationSession | undefined ;
176177
177- constructor (
178- readonly id : string ,
179- readonly label : string ,
180- private readonly _accountLabel : string = localize ( 'languageModelsAccountId' , 'Language Models' )
181- ) { }
178+ constructor ( readonly id : string , readonly label : string , private readonly _accountLabel : string ) { }
182179
183180 async getSessions ( scopes ?: string [ ] | undefined ) : Promise < readonly AuthenticationSession [ ] > {
184181 // If there are no scopes and no session that means no extension has requested a session yet
0 commit comments