Skip to content

fix: Make tool_args optional in validate_tool_request (#1448)#1449

Closed
lx277856602 wants to merge 1 commit intoagent0ai:mainfrom
lx277856602:main
Closed

fix: Make tool_args optional in validate_tool_request (#1448)#1449
lx277856602 wants to merge 1 commit intoagent0ai:mainfrom
lx277856602:main

Conversation

@lx277856602
Copy link
Copy Markdown

🐛 Fixes #1448

Problem

After upgrading to v1.7, calling any skill results in:

ValueError: Tool request must have a tool_args (type dictionary) field

This happens when tools are called without arguments, which should be valid.

Root Cause

The validate_tool_request function requires tool_args to be present, but the subsequent process_tools function already handles missing tool_args with a default empty dict.

Solution

Modified validate_tool_request to make tool_args optional:

  • Only validate tool_args type if explicitly provided
  • Allow tools to be called without arguments
  • Maintains backward compatibility with v1.6 behavior

Changes

  • File: agent.py
  • Lines: 976-982
  • Change: 3 insertions, 2 deletions

Testing

✅ Tools without arguments now work correctly
✅ Tools with arguments continue to work as before
✅ Backward compatible


Ready for review! 🚀

## Problem
After upgrading to v1.7, calling any skill results in:
`ValueError: Tool request must have a tool_args (type dictionary) field`

This happens when tools are called without arguments, which should be valid.

## Solution
Changed validation to make tool_args optional:
- tool_args is no longer required in validate_tool_request
- process_tools already handles missing tool_args with default {}
- Only validate tool_args type if explicitly provided

## Testing
- Tools without arguments now work correctly
- Tools with arguments continue to work as before
- Backward compatible with v1.6 behavior

Fixes agent0ai#1448
@3clyp50
Copy link
Copy Markdown
Contributor

3clyp50 commented Apr 7, 2026

Solved in #1466

@3clyp50 3clyp50 closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

validate_tool_request raise ValueError("Tool request must have a tool_args (type dictionary) field")

2 participants