From 73771a43da9ef119ef67422781fccfadc984622e Mon Sep 17 00:00:00 2001 From: Yuan Tang Date: Tue, 25 Feb 2025 21:45:24 -0500 Subject: [PATCH] fix(agent): Raise exception when tool call has empty name Signed-off-by: Yuan Tang --- .../providers/inline/agents/meta_reference/agent_instance.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llama_stack/providers/inline/agents/meta_reference/agent_instance.py b/llama_stack/providers/inline/agents/meta_reference/agent_instance.py index 8c10c6baf..248d90446 100644 --- a/llama_stack/providers/inline/agents/meta_reference/agent_instance.py +++ b/llama_stack/providers/inline/agents/meta_reference/agent_instance.py @@ -1077,6 +1077,8 @@ async def execute_tool_call_maybe( tool_to_group: Dict[str, str], ) -> ToolInvocationResult: name = tool_call.tool_name + if not name: + raise ValueError("Tool call has an empty name. Tool call may not have been invoked.") group_name = tool_to_group.get(name, None) if group_name is None: raise ValueError(f"Tool {name} not found in any tool group")