@@ -46,6 +46,8 @@ export async function showAIProviderPicker(
4646 const subscription = getSettledValue ( subscriptionResult ) ! ;
4747 const hasPaidPlan = isSubscriptionPaidPlan ( subscription . plan . effective . id ) && subscription . account ?. verified ;
4848
49+ const hasProvidersDisabledByOrg = container . ai . hasProvidersDisabledByOrg ( ) ;
50+
4951 const quickpick = window . createQuickPick < ProviderQuickPickItem > ( ) ;
5052 quickpick . ignoreFocusOut = getQuickPickIgnoreFocusOut ( ) ;
5153 quickpick . title = 'Select AI Provider' ;
@@ -62,8 +64,17 @@ export async function showAIProviderPicker(
6264 : undefined ;
6365
6466 let addedRequiredKeySeparator = false ;
67+
6568 while ( true ) {
6669 const items : ProviderQuickPickItem [ ] = [ ] ;
70+ if ( hasProvidersDisabledByOrg ) {
71+ items . push ( {
72+ label : '' ,
73+ description : '$(lock) Some Al providers have been disabled by your GitKraken Admin' ,
74+ iconPath : new ThemeIcon ( 'blank' ) ,
75+ provider : undefined ! ,
76+ } ) ;
77+ }
6778 for ( const p of providers . values ( ) ) {
6879 if ( ! p . primary && ! addedRequiredKeySeparator ) {
6980 addedRequiredKeySeparator = true ;
@@ -96,7 +107,11 @@ export async function showAIProviderPicker(
96107 quickpick . onDidHide ( ( ) => resolve ( undefined ) ) ,
97108 quickpick . onDidAccept ( ( ) => {
98109 if ( quickpick . activeItems . length !== 0 ) {
99- resolve ( quickpick . activeItems [ 0 ] ) ;
110+ const selectedItem = quickpick . activeItems [ 0 ] ;
111+ // Don't allow selection of the disabled providers message
112+ if ( selectedItem . provider !== undefined ) {
113+ resolve ( selectedItem ) ;
114+ }
100115 }
101116 } ) ,
102117 quickpick . onDidTriggerItemButton ( e => {
0 commit comments