Description
When using MiniMax models (M2.5, M2.7) with Strix, all tool calls fail with errors like "missing required positional argument" even though the model is attempting to call tools correctly.
Root Cause
There are two related issues:
1. Parameter format mismatch
MiniMax outputs tool call parameters in Anthropic-style XML with name attribute:
<parameter name="action">launch</parameter>
But Strix expects OpenAI-style format:
<parameter=action>launch</parameter>
The normalize_tool_format() function has a _PARAM_NAME_ATTR regex to handle this conversion, but it only triggers when "<invoke" in content or "<function_calls" in content. MiniMax uses <function=name> format (which IS supported for opening tags), but this does NOT trigger the name attribute normalization for <parameter name="x">.
2. Thinking blocks interfere with tool call parsing
MiniMax models output thinking in <thinking>...</thinking> blocks inline in the response content. When tool call XML appears inside thinking blocks, _stream() in llm.py incorrectly detects </function> inside the thinking block and truncates the response prematurely.
Claude/GPT/Gemini output thinking via the API reasoning field (separate from content), so this conflict does not occur with officially supported models.
Environment
Evidence from events.jsonl
Raw model output captured in chat.message events shows the format:
<function=browser_action>
<parameter name="action">launch</parameter>
<parameter name="url">http://host.docker.internal/</parameter>
</function>
Tool execution fails because parameter parsing returns empty values.
Suggested Fixes
-
In normalize_tool_format() in strix/llm/utils.py: extend the trigger condition to also run _PARAM_NAME_ATTR conversion when "<parameter name=" is detected in content, regardless of whether <invoke or <function_calls> is present.
-
In _stream() in strix/llm/llm.py: strip <thinking>...</thinking> blocks from accumulated before checking for </function> tags, so that tool calls inside thinking blocks do not cause false positives.
Description
When using MiniMax models (M2.5, M2.7) with Strix, all tool calls fail with errors like "missing required positional argument" even though the model is attempting to call tools correctly.
Root Cause
There are two related issues:
1. Parameter format mismatch
MiniMax outputs tool call parameters in Anthropic-style XML with
nameattribute:But Strix expects OpenAI-style format:
The
normalize_tool_format()function has a_PARAM_NAME_ATTRregex to handle this conversion, but it only triggers when"<invoke" in contentor"<function_calls" in content. MiniMax uses<function=name>format (which IS supported for opening tags), but this does NOT trigger thenameattribute normalization for<parameter name="x">.2. Thinking blocks interfere with tool call parsing
MiniMax models output thinking in
<thinking>...</thinking>blocks inline in the response content. When tool call XML appears inside thinking blocks,_stream()inllm.pyincorrectly detects</function>inside the thinking block and truncates the response prematurely.Claude/GPT/Gemini output thinking via the API
reasoningfield (separate from content), so this conflict does not occur with officially supported models.Environment
Evidence from events.jsonl
Raw model output captured in chat.message events shows the format:
Tool execution fails because parameter parsing returns empty values.
Suggested Fixes
In
normalize_tool_format()instrix/llm/utils.py: extend the trigger condition to also run_PARAM_NAME_ATTRconversion when"<parameter name="is detected in content, regardless of whether<invokeor<function_calls>is present.In
_stream()instrix/llm/llm.py: strip<thinking>...</thinking>blocks fromaccumulatedbefore checking for</function>tags, so that tool calls inside thinking blocks do not cause false positives.