Skip to content

Fix inconsistent tool validation and prevent system crashes on misformatted requests (Fixes #1349)#1481

Open
mdnaimul22 wants to merge 2 commits intoagent0ai:mainfrom
mdnaimul22:fix-tool-validation-consistency
Open

Fix inconsistent tool validation and prevent system crashes on misformatted requests (Fixes #1349)#1481
mdnaimul22 wants to merge 2 commits intoagent0ai:mainfrom
mdnaimul22:fix-tool-validation-consistency

Conversation

@mdnaimul22
Copy link
Copy Markdown

This PR addresses the ValueError: Tool request must have a tool_name (type string) field error (see #1349).

Changes:

  1. Updated validate_tool_request in agent.py to support tool and args aliases matching the extraction logic in process_tools.
  2. Changed exception from ValueError to RepairableException. This allows the message loop to stay alive and surfaces the format error back to the model for self-repair.
  3. Relaxed validation for empty arguments to allow tools with no parameters.

This fix significantly improves framework stability when using models that might deviate slightly from the expected JSON schema.

@mdnaimul22 mdnaimul22 force-pushed the fix-tool-validation-consistency branch from 4f720b0 to 35bd59e Compare April 9, 2026 19:51
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.

1 participant