From 114abd1c1131ceb5e2364b77f114ddca2957c734 Mon Sep 17 00:00:00 2001 From: Nikhil Kulkarni Date: Wed, 9 Sep 2026 00:51:45 -0700 Subject: [PATCH] [Bugfix][Frontend] Reject unsupported Responses API input items with 400 instead of 500 (#55974) Signed-off-by: Nikhil Kulkarni Co-authored-by: Claude Fable 5.1 --- vllm/entrypoints/openai/responses/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vllm/entrypoints/openai/responses/utils.py b/vllm/entrypoints/openai/responses/utils.py index 173eb37906..82ab75f756 100644 --- a/vllm/entrypoints/openai/responses/utils.py +++ b/vllm/entrypoints/openai/responses/utils.py @@ -336,7 +336,13 @@ def _construct_message_from_response_item( prev_assistant_msg["content"] = text return None return {"role": "assistant", "content": text} - return item # type: ignore[arg-type] + if isinstance(item, dict) and "role" in item: + return item # type: ignore[return-value] + item_type = item.get("type") if isinstance(item, dict) else item.type + raise VLLMValidationError( + f"Unsupported input item type: {item_type}", + parameter="input", + ) def extract_function_tool_names(tools: list[Tool]) -> frozenset[str]: