[Bugfix] Handle malformed namespace tools (#53763)

Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>

Taneem Ibrahim committed Aug 27, 2026 at 14:18 UTC d7b6a35967ba72ebece3dc8466b77d315cebdfec
1 file changed +9 -2
vllm/entrypoints/openai/responses/protocol.py
+9 -2
@@ -622,8 +622,15 @@ class ResponsesRequest(OpenAIBaseModel):
622 if isinstance(tool, dict):
623 if tool.get("type") == "namespace":
624 namespace = tool.get("name")
625 - for namespaced_tool in tool.get("tools", []):
626 - namespaced_name = namespaced_tool.get("name")
625 + namespaced_tools = tool.get("tools")
626 + if not isinstance(namespaced_tools, list):
627 + return data
628 + for namespaced_tool in namespaced_tools:
629 + namespaced_name = (
630 + namespaced_tool.get("name")
631 + if isinstance(namespaced_tool, dict)
632 + else getattr(namespaced_tool, "name", None)
633 + )
634 tool_names.add(namespaced_name)
635 tool_names.add(f"{namespace}__{namespaced_name}")
636 else: