@@ -191,7 +191,7 @@ def test_multiple_model_restrictions(self):
191191 # grok-4 should NOT be allowed
192192 assert provider .validate_model_name ("grok-4" ) is False
193193
194- @patch .dict (os .environ , {"XAI_ALLOWED_MODELS" : "grok,grok-4.1-fast" })
194+ @patch .dict (os .environ , {"XAI_ALLOWED_MODELS" : "grok,grok-4,grok-4 .1-fast,grok-4-1-fast-reasoning " })
195195 def test_both_shorthand_and_full_name_allowed (self ):
196196 """Test that aliases and canonical names can be allowed together."""
197197 # Clear cached restriction service
@@ -201,10 +201,11 @@ def test_both_shorthand_and_full_name_allowed(self):
201201
202202 provider = XAIModelProvider ("test-key" )
203203
204- # Both shorthand and full name should be allowed
205- assert provider .validate_model_name ("grok" ) is True # Resolves to grok-4
206- assert provider .validate_model_name ("grok-4" ) is True
207- assert provider .validate_model_name ("grok-4.1-fast" ) is True
204+ # Both shorthand and full name should be allowed when explicitly listed
205+ assert provider .validate_model_name ("grok" ) is True # Alias explicitly allowed
206+ assert provider .validate_model_name ("grok-4" ) is True # Canonical name explicitly allowed
207+ assert provider .validate_model_name ("grok-4.1-fast" ) is True # Alias explicitly allowed
208+ assert provider .validate_model_name ("grok-4-1-fast-reasoning" ) is True # Canonical name explicitly allowed
208209
209210 @patch .dict (os .environ , {"XAI_ALLOWED_MODELS" : "" })
210211 def test_empty_restrictions_allows_all (self ):
0 commit comments