[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>
This commit is contained in:
Nikhil Kulkarni
2026-09-09 07:51:45 +00:00
committed by GitHub
co-authored by Claude Fable 5.1
parent d2906091bf
commit 114abd1c11
+7 -1
View File
@@ -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]: