mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-26 10:41:29 +00:00
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:
parent
2d95cd9fc0
commit
7cf8905af5
1 changed files with 1 additions and 1 deletions
2
agent.py
2
agent.py
|
|
@ -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")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue