Merge pull request #1381 from nicolasleao/development
Some checks are pending
Build And Publish Docker Images / plan (push) Waiting to run
Build And Publish Docker Images / build (push) Blocked by required conditions

fix: let agents fix their own tool call format instead of erroring
This commit is contained in:
Nicolas Leão 2026-03-29 16:12:23 -03:00 committed by GitHub
commit 4b9f0ecc23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -848,8 +848,10 @@ class Agent:
# search for tool usage requests in agent message
tool_request = extract_tools.json_parse_dirty(msg)
# basic validation + extensions
await self.validate_tool_request(tool_request)
# Only validate when extraction produced an object; None means no JSON tool
# block was found — the misformat warning path below handles that.
if tool_request is not None:
await self.validate_tool_request(tool_request)
if tool_request is not None:
raw_tool_name = tool_request.get("tool_name", tool_request.get("tool","")) # Get the raw tool name