Three silent bugs found in Mistral AI's Python libraries
An audit of mistral-common and client-python uncovered three bugs where code runs without errors but returns wrong results: optional tool parameters become mandatory, a dict[str, int] field can never hold a key, and a trailing newline slips past name validation. Fixes with regression tests were submitted upstream (issues #632, #633, PR #354).
- create_tool_call drops the default: unit lands in required instead of ['city']
- The SDK overwrites additionalProperties on dict[str, int] with false, emptying the field
- re.match with $ accepts 'get_weather\n' and 10-char ids; fullmatch is needed
- All three bugs reproduced, fixed and submitted upstream with tests
Read next
Security