fix: Make tool_args optional in validate_tool_request (#1448)#1449
Closed
lx277856602 wants to merge 1 commit intoagent0ai:mainfrom
Closed
fix: Make tool_args optional in validate_tool_request (#1448)#1449lx277856602 wants to merge 1 commit intoagent0ai:mainfrom
lx277856602 wants to merge 1 commit intoagent0ai:mainfrom
Conversation
## 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
Contributor
|
Solved in #1466 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Fixes #1448
Problem
After upgrading to v1.7, calling any skill results in:
This happens when tools are called without arguments, which should be valid.
Root Cause
The
validate_tool_requestfunction requirestool_argsto be present, but the subsequentprocess_toolsfunction already handles missingtool_argswith a default empty dict.Solution
Modified
validate_tool_requestto maketool_argsoptional:tool_argstype if explicitly providedChanges
agent.pyTesting
✅ Tools without arguments now work correctly
✅ Tools with arguments continue to work as before
✅ Backward compatible
Ready for review! 🚀