Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,11 @@ async def process_tools(self, msg: str):
# 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:
# Normalize: map 'args' -> 'tool_args', default to empty dict
if "tool_args" not in tool_request:
tool_request["tool_args"] = tool_request.get("args", {})
if not isinstance(tool_request["tool_args"], dict):
tool_request["tool_args"] = {}
await self.validate_tool_request(tool_request)

if tool_request is not None:
Expand Down