@@ -120,15 +120,16 @@ export class MainThreadChatProvider implements MainThreadChatProviderShape {
120
120
return Disposable . None ;
121
121
}
122
122
123
+ const accountLabel = auth . accountLabel ?? localize ( 'languageModelsAccountId' , 'Language Models' ) ;
123
124
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 ) ) ;
125
126
disposables . add ( toDisposable ( ( ) => {
126
127
this . _authenticationService . unregisterAuthenticationProvider ( authProviderId ) ;
127
128
} ) ) ;
128
129
disposables . add ( this . _authenticationService . onDidChangeSessions ( async ( e ) => {
129
130
if ( e . providerId === authProviderId ) {
130
131
if ( e . event . removed ?. length ) {
131
- const allowedExtensions = this . _authenticationService . readAllowedExtensions ( authProviderId , authProviderId ) ;
132
+ const allowedExtensions = this . _authenticationService . readAllowedExtensions ( authProviderId , accountLabel ) ;
132
133
const extensionsToUpdateAccess = [ ] ;
133
134
for ( const allowed of allowedExtensions ) {
134
135
const from = await this . _extensionService . getExtension ( allowed . id ) ;
@@ -146,7 +147,7 @@ export class MainThreadChatProvider implements MainThreadChatProviderShape {
146
147
}
147
148
} ) ) ;
148
149
disposables . add ( this . _authenticationService . onDidChangeExtensionSessionAccess ( async ( e ) => {
149
- const allowedExtensions = this . _authenticationService . readAllowedExtensions ( authProviderId , authProviderId ) ;
150
+ const allowedExtensions = this . _authenticationService . readAllowedExtensions ( authProviderId , accountLabel ) ;
150
151
const accessList = [ ] ;
151
152
for ( const allowedExtension of allowedExtensions ) {
152
153
const from = await this . _extensionService . getExtension ( allowedExtension . id ) ;
@@ -174,11 +175,7 @@ class LanguageModelAccessAuthProvider implements IAuthenticationProvider {
174
175
175
176
private _session : AuthenticationSession | undefined ;
176
177
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 ) { }
182
179
183
180
async getSessions ( scopes ?: string [ ] | undefined ) : Promise < readonly AuthenticationSession [ ] > {
184
181
// If there are no scopes and no session that means no extension has requested a session yet
0 commit comments