Bug: HTTP 400 Param Incorrect / failed during process multi-modal data when history has many large base64 images
Summary
When a long conversation accumulates many large base64 PNG attachments, the chat completion request fails with HTTP 400:
{
"error": {
"code": "400",
"message": "Param Incorrect",
"param": "failed during process multi-modal data",
"type": ""
}
}
The error is not retryable (isRetryable: false). It blocks further turns in that session until old images are removed from history.
Environment
- App: MiMo Desktop (Windows)
- Engine: MiMo-Code in-process server
- Model / provider:
mimo-v2.6-proviaxiaomi-mimo-token-plan(https://token-plan-cn.xiaomimimo.com/v1/chat/completions) - OS: Windows
- Date: 2026-09-24
- Session:
ses_fff4da3a1ffe6u2I9ZapIUz1Dp(title: 铁路复兴)
Reproduction
- Open a long session and paste many large PNG images over several days (user paste attachments, often multi-MB screenshots / generated images).
- Images are stored as
data:image/png;base64,...insidepartrows and are re-sent on every turn. - After enough large images accumulate, send any new message (even text-only + one new image).
- API returns 400
Param Incorrect/failed during process multi-modal data.
Observed data (before cleanup)
From local engine logs + SQLite inspection of part table for this session:
| Metric | Value |
|---|---|
| Messages / parts | 11,247 / 42,727 |
| Total part payload | ~168 MB |
| Image-related part payload | ~105 MB (211 image parts, 97 messages) |
| Largest single image part | ~5.85 MB base64 (~4.4 MB PNG) |
Real data:image messages |
22 (after filtering false-positive text mentions) |
Example large image part sizes (base64 length):
- 5,851,028 / 4,727,480 / 4,651,252 / 4,409,872 / 4,358,644 …
Error log excerpt (truncated):
ERROR service=llm providerID=xiaomi-mimo-token-plan modelID=mimo-v2.6-pro
statusCode=400
responseBody={"error":{"code":"400","message":"Param Incorrect","param":"failed during process multi-modal data","type":""}}
isRetryable=false
url=https://token-plan-cn.xiaomimimo.com/v1/chat/completions
Failing user turn content included a station-sunset image plus text:
这就是用你之前提示词画的车站夕阳 你看要不要优化一下提示词
Expected
- Either accept the multimodal payload, or
- Return a clear, actionable client-side error (e.g. “too many / too large images in history”) so Desktop can prompt to compress/strip old images, and/or
- Support compaction/exclusion of historical image parts from the outbound request while keeping text history.
Actual
Opaque 400 Param Incorrect with param=failed during process multi-modal data, non-retryable; conversation becomes unusable until images are manually deleted.
Workaround performed locally
Deleted 17 messages (130 parts, ~81 MB of base64) dated before 2026-09-24 from this session via direct SQLite (message/part), keeping only today’s 5 image messages (~24 MB). Session part payload dropped ~168 MB → ~77 MB; PRAGMA integrity_check = ok.
This suggests the gateway rejects when historical multimodal volume (or per-image size) exceeds a threshold, but the threshold and which field fails are not surfaced to the client.
Suggested fixes
- Document multimodal limits (max images per request, max base64 size per image, max cumulative multimodal bytes).
- Client-side preflight in Desktop/engine: warn before send when history image bytes exceed limit; offer compress / drop old images / fork clean branch.
- Server: return structured error codes (e.g.
image_too_large,too_many_images,multimodal_payload_too_large) instead of genericParam Incorrect. - Optional: store large images outside the chat payload (file reference / URL) and only send recent images as vision context.
Logs
Local Desktop log: AppData/Roaming/Xiaomi MiMo/logs/2026-09-24.log
Engine log: ~/.mimocode_home/data/log/2026-09-24T021949680Z-main-*.log*
(contains full request body with embedded base64 — not pasted here for size/privacy)
Labels
bug, api
Versions
- MiMo Desktop FileVersion: 26.923.232338
- MiMo-Code CLI (@mimo-ai/cli): .1.14
- Windows: Microsoft Windows NT 10.0.26300.0 (PowerShell 5.1 / build 26100)
- Request image_url parts in failing payload (from engine log): 49 occurrences of data:image/png;base64 (includes history replay)
- Max single base64 length in payload: 5,851,028 chars (~4.4 MB binary PNG)
Closing as duplicate of #2535 (created moments earlier with the same content).