[BUG] Azure json.loads TypeError on dict or null tool arguments
Author: MohammadHijjawi97Created Sep 17, 2026Updated Sep 17, 2026
Description
Azure completion parses tool arguments with json.loads and only catches JSONDecodeError. Already-parsed dicts and JSON null raise TypeError and abort the call. OpenAI's native provider already guards string vs dict.
Steps to Reproduce
Streamed or replayed Azure tool calls can carry arguments as a dict or as None. json.loads(None) and json.loads({"city": "London"}) both raise TypeError.
Expected behavior
A dict is used as-is. None or blank strings become {}. Invalid JSON is logged and skipped, matching the current JSONDecodeError path.
Screenshots/Code snippets
TypeError: the JSON object must be str, bytes or bytearray, not dict
Operating System
Windows 11
Python Version
3.12
crewAI Version
main
Source: crewAIInc/crewAI