File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -325,12 +325,16 @@ export class AIProviderService implements Disposable {
325325
326326 let chosenProviderId : AIProviders | undefined ;
327327 let chosenModel : AIModel | undefined ;
328+ const orgAiConf = getOrgAIConfig ( ) ;
328329
329330 if ( ! options ?. force ) {
330331 const vsCodeModels = await this . getModels ( 'vscode' ) ;
331- if ( vsCodeModels . length !== 0 ) {
332+ if ( isProviderEnabledByOrg ( 'vscode' , orgAiConf ) && vsCodeModels . length !== 0 ) {
332333 chosenProviderId = 'vscode' ;
333- } else if ( ( await this . container . subscription . getSubscription ( ) ) . account ?. verified ) {
334+ } else if (
335+ isProviderEnabledByOrg ( 'gitkraken' , orgAiConf ) &&
336+ ( await this . container . subscription . getSubscription ( ) ) . account ?. verified
337+ ) {
334338 chosenProviderId = 'gitkraken' ;
335339 const gitkrakenModels = await this . getModels ( 'gitkraken' ) ;
336340 chosenModel = gitkrakenModels . find ( m => m . default ) ;
@@ -422,6 +426,12 @@ export class AIProviderService implements Disposable {
422426 providerId = model . provider . id ;
423427 }
424428
429+ if ( providerId && ! isProviderEnabledByOrg ( providerId ) ) {
430+ this . _provider = undefined ;
431+ this . _model = undefined ;
432+ return undefined ;
433+ }
434+
425435 let changed = false ;
426436
427437 if ( providerId !== this . _provider ?. id ) {
You can’t perform that action at this time.
0 commit comments