@@ -227,22 +227,23 @@ def test_validate_blob_missing_model_raises(monkeypatch: pytest.MonkeyPatch) ->
227227 assert "model is required" in exc .value .detail
228228
229229
230- def test_validate_blob_model_not_found_raises (
230+ def test_validate_blob_model_not_found_warns_and_continues (
231231 monkeypatch : pytest .MonkeyPatch ,
232+ caplog : pytest .LogCaptureFixture ,
232233) -> None :
233- """Model that doesn't exist in model_config raises 400 with model name in detail ."""
234+ """Missing model logs a warning and lets the request proceed ."""
234235 _patch_validators (monkeypatch , row = None , supported = False )
235236 blob = _make_blob ("openai" , "text" , {"model" : "gpt-4-turbo" })
236- with pytest . raises ( HTTPException ) as exc :
237+ with caplog . at_level ( "WARNING" ) :
237238 model_config_crud .validate_blob_model_or_raise (session = None , blob = blob ) # type: ignore[arg-type]
238- assert exc . value . status_code == 400
239- assert "gpt-4-turbo " in exc . value . detail
239+ assert "gpt-4-turbo" in caplog . text
240+ assert "not found " in caplog . text
240241
241242
242- def test_validate_blob_wrong_type_for_model_raises (
243+ def test_validate_blob_wrong_type_for_model_passes (
243244 monkeypatch : pytest .MonkeyPatch ,
244245) -> None :
245- """Model that exists but is wrong type (e.g. TTS model used as text) raises 400 with allowed list ."""
246+ """Wrong completion type no longer validated — request proceeds silently ."""
246247 row = SimpleNamespace (config = {})
247248 _patch_validators (
248249 monkeypatch ,
@@ -251,11 +252,7 @@ def test_validate_blob_wrong_type_for_model_raises(
251252 allowed = ["gpt-4o" , "gpt-4o-mini" ],
252253 )
253254 blob = _make_blob ("openai" , "text" , {"model" : "some-audio-model" })
254- with pytest .raises (HTTPException ) as exc :
255- model_config_crud .validate_blob_model_or_raise (session = None , blob = blob ) # type: ignore[arg-type]
256- assert exc .value .status_code == 400
257- assert "some-audio-model" in exc .value .detail
258- assert "gpt-4o" in exc .value .detail
255+ model_config_crud .validate_blob_model_or_raise (session = None , blob = blob ) # type: ignore[arg-type]
259256
260257
261258def test_validate_blob_supported_text_passes (monkeypatch : pytest .MonkeyPatch ) -> None :
@@ -265,9 +262,11 @@ def test_validate_blob_supported_text_passes(monkeypatch: pytest.MonkeyPatch) ->
265262 model_config_crud .validate_blob_model_or_raise (session = None , blob = blob ) # type: ignore[arg-type]
266263
267264
268- def test_validate_blob_tts_invalid_voice_raises (
265+ def test_validate_blob_tts_invalid_voice_warns (
269266 monkeypatch : pytest .MonkeyPatch ,
267+ caplog : pytest .LogCaptureFixture ,
270268) -> None :
269+ """Invalid TTS voice logs a warning but does not raise."""
271270 row = SimpleNamespace (
272271 config = {"voice" : {"type" : "enum" , "options" : ["Kore" , "Orus" ]}}
273272 )
@@ -277,11 +276,10 @@ def test_validate_blob_tts_invalid_voice_raises(
277276 "tts" ,
278277 {"model" : "gemini-2.5-flash-preview-tts" , "voice" : "Sarah" },
279278 )
280- with pytest . raises ( HTTPException ) as exc :
279+ with caplog . at_level ( "WARNING" ) :
281280 model_config_crud .validate_blob_model_or_raise (session = None , blob = blob ) # type: ignore[arg-type]
282- assert exc .value .status_code == 400
283- assert "Sarah" in exc .value .detail
284- assert "Kore" in exc .value .detail
281+ assert "Sarah" in caplog .text
282+ assert "Kore" in caplog .text
285283
286284
287285def test_validate_blob_tts_valid_voice_passes (
@@ -309,26 +307,19 @@ def test_validate_blob_tts_no_voice_spec_passes(
309307 model_config_crud .validate_blob_model_or_raise (session = None , blob = blob ) # type: ignore[arg-type]
310308
311309
312- def test_validate_blob_stt_model_rejected_for_text_type (
310+ def test_validate_blob_stt_model_passes_for_text_type (
313311 monkeypatch : pytest .MonkeyPatch ,
314312) -> None :
315- """STT-only model (audio input) must be rejected when type=text.
316-
317- Regression: previously only stt/tts triggered is_model_supported; type=text
318- only checked model existence, so gemini-2.5-pro (STT) passed as a text model.
319- """
313+ """Completion-type mismatch no longer enforced — STT model passes for type=text."""
320314 row = SimpleNamespace (config = {})
321315 _patch_validators (
322316 monkeypatch ,
323317 row = row ,
324- supported = False , # modality filter excludes AUDIO-input models for type=text
318+ supported = False ,
325319 allowed = ["gpt-4o" , "gpt-4o-mini" ],
326320 )
327321 blob = _make_blob ("google" , "text" , {"model" : "gemini-2.5-pro" })
328- with pytest .raises (HTTPException ) as exc :
329- model_config_crud .validate_blob_model_or_raise (session = None , blob = blob ) # type: ignore[arg-type]
330- assert exc .value .status_code == 400
331- assert "gemini-2.5-pro" in exc .value .detail
322+ model_config_crud .validate_blob_model_or_raise (session = None , blob = blob ) # type: ignore[arg-type]
332323
333324
334325def test_validate_blob_text_model_accepted_for_text_type (
0 commit comments