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
6 changes: 5 additions & 1 deletion agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +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:
await self.validate_tool_request(tool_request)
try:
await self.validate_tool_request(tool_request)
except ValueError:
# Malformed JSON from LLM — treat as misformat, not fatal crash
tool_request = None

if tool_request is not None:
raw_tool_name = tool_request.get("tool_name", tool_request.get("tool","")) # Get the raw tool name
Expand Down