fix: validate_tool_request rejects empty tool_args dict (PATCH-015)

Bug: not tool_request.get("tool_args") evaluates True for empty dict {}
causing ValueError crash on any tool call with no arguments.
Scheduler list_tasks, health checks, etc all broken.

Fix: Changed to existence check ("tool_args" not in tool_request)

Co-authored-by: Agent Zero <agent@zero>
This commit is contained in:
Greg DeYoung 2026-04-07 01:09:00 +00:00
parent 2d95cd9fc0
commit 7cf8905af5

View file

@ -978,7 +978,7 @@ class Agent:
raise ValueError("Tool request must be a dictionary")
if not tool_request.get("tool_name") or not isinstance(tool_request.get("tool_name"), str):
raise ValueError("Tool request must have a tool_name (type string) field")
if not tool_request.get("tool_args") or not isinstance(tool_request.get("tool_args"), dict):
if "tool_args" not in tool_request or not isinstance(tool_request.get("tool_args"), dict):
raise ValueError("Tool request must have a tool_args (type dictionary) field")