[Bugfix][Frontend] Reject unsupported Responses API input items with 400 instead of 500 (#55974)

Signed-off-by: Nikhil Kulkarni <nikhilkulkarni1755@gmail.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>

Nikhil Kulkarni committed Sep 9, 2026 at 00:51 UTC 114abd1c1131ceb5e2364b77f114ddca2957c734
1 file changed +7 -1
vllm/entrypoints/openai/responses/utils.py
+7 -1
@@ -336,7 +336,13 @@ def _construct_message_from_response_item(
336 prev_assistant_msg["content"] = text
337 return None
338 return {"role": "assistant", "content": text}
339 - return item # type: ignore[arg-type]
339 + if isinstance(item, dict) and "role" in item:
340 + return item # type: ignore[return-value]
341 + item_type = item.get("type") if isinstance(item, dict) else item.type
342 + raise VLLMValidationError(
343 + f"Unsupported input item type: {item_type}",
344 + parameter="input",
345 + )
346
347
348 def extract_function_tool_names(tools: list[Tool]) -> frozenset[str]: