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>
Greg DeYoung committed
Apr 7, 2026 at 01:09 UTC
7cf8905af50f3d0655dacad750091f9af85528da
1 file changed
+1
-1
agent.py
+1
-1
@@ -978,7 +978,7 @@ class Agent:
978
raise ValueError("Tool request must be a dictionary")
979
if not tool_request.get("tool_name") or not isinstance(tool_request.get("tool_name"), str):
980
raise ValueError("Tool request must have a tool_name (type string) field")
981
- if not tool_request.get("tool_args") or not isinstance(tool_request.get("tool_args"), dict):
981
+ if "tool_args" not in tool_request or not isinstance(tool_request.get("tool_args"), dict):
982
raise ValueError("Tool request must have a tool_args (type dictionary) field")
983
984