[Bugfix][Frontend] Raise VLLMValidationError for user-facing errors in chat_utils.py (#50491)

Signed-off-by: latent-9 <296084221+latent-9@users.noreply.github.com>
Co-authored-by: latent-9 <296084221+latent-9@users.noreply.github.com>
This commit is contained in:
Recoordinate
2026-07-31 11:54:43 +00:00
committed by GitHub
co-authored by latent-9
parent f5ffc59b6a
commit 0b5b49dde8
3 changed files with 13 additions and 7 deletions
@@ -2092,7 +2092,7 @@ def test_parse_chat_messages_multiple_images_interleave_with_placeholders(
image_url,
):
with pytest.raises(
ValueError,
VLLMValidationError,
match=r"Found more '<|image_1|>' placeholders in input prompt "
"than actual multimodal data items.",
):
@@ -316,7 +316,7 @@ _PLACEHOLDER_ERROR_PATTERN: Final[str] = re.sub(
def test_parse_chat_messages_rejects_placeholder_in_user_text(content):
mc = _make_mock_model_config() # enable_prompt_embeds=True by default
messages = [{"role": "user", "content": content}]
with pytest.raises(ValueError, match=_PLACEHOLDER_ERROR_PATTERN):
with pytest.raises(VLLMValidationError, match=_PLACEHOLDER_ERROR_PATTERN):
parse_chat_messages(messages, mc, content_format="openai")