Roo Code: MiMo-V2.5 chat template crashes when system.content is an OpenAI content-part array

#12
by Spordleoo - opened

Hi Xiaomi MiMo team,

I found a compatibility issue when serving XiaomiMiMo/MiMo-V2.5 with the recommended SGLang image and using OpenAI-compatible clients such as Roo Code. I do believe I have the latest version of the templates as I only downloaded the model after that warning message.

The model works correctly when the system message content is a plain string, but crashes when system.content is provided as an OpenAI-style content-part array.

Environment:

Model: XiaomiMiMo/MiMo-V2.5
Serving image: lmsysorg/sglang:dev-mimo-v2.5
Backend: SGLang OpenAI-compatible /v1/chat/completions
Command includes:
--reasoning-parser mimo
--tool-call-parser mimo
--trust-remote-code
--attention-backend fa3

Minimal repro:

curl -s http://127.0.0.1:8000/v1/chat/completions
-H 'Content-Type: application/json'
-d '{
"model": "model_name",
"messages": [
{
"role": "system",
"content": [
{"type": "text", "text": "You are a helpful coding assistant."}
]
},
{
"role": "user",
"content": "Say hello in one sentence."
}
],
"max_tokens": 64
}'

Actual result:

500 Internal Server Error

TypeError: can only concatenate str (not "list") to str

Trace points to the HF chat template rendering path:

transformers/tokenization_utils_base.py -> apply_chat_template
transformers/utils/chat_template_utils.py -> render_jinja_template
jinja2/environment.py -> compiled_template.render

Xiaomi MiMo org

thank you ! will take a look soon

Update: I found the root cause on my side.

The issue only occurred when I served MiMo-V2.5 with:

--reasoning-parser mimo

Switching the reasoning parser to Qwen 3 fixed the Roo Code compatibility issue:

--reasoning-parser qwen3

With --reasoning-parser qwen3, the same OpenAI-style structured system.content request no longer crashes.

So this may not be an issue with the MiMo-V2.5 model files or chat template directly. It appears to be related to the mimo reasoning parser path in SGLang when handling OpenAI-compatible clients that send system messages as content-part arrays.

Sorry for the earlier confusion, and thanks again for taking a look.

Spordleoo changed discussion status to closed

Sign up or log in to comment