MiMo-Code icon indicating copy to clipboard operation
MiMo-Code copied to clipboard

Bug: HTTP 400 Param Incorrect / failed during process multi-modal data when history has many large base64 images

Open NMDX0721 opened this issue 2 months ago • 1 comments

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-pro via xiaomi-mimo-token-plan (https://token-plan-cn.xiaomimimo.com/v1/chat/completions)
  • OS: Windows
  • Date: 2026-09-24
  • Session: ses_fff4da3a1ffe6u2I9ZapIUz1Dp (title: 铁路复兴)

Reproduction

  1. Open a long session and paste many large PNG images over several days (user paste attachments, often multi-MB screenshots / generated images).
  2. Images are stored as data:image/png;base64,... inside part rows and are re-sent on every turn.
  3. After enough large images accumulate, send any new message (even text-only + one new image).
  4. 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

  1. Document multimodal limits (max images per request, max base64 size per image, max cumulative multimodal bytes).
  2. Client-side preflight in Desktop/engine: warn before send when history image bytes exceed limit; offer compress / drop old images / fork clean branch.
  3. Server: return structured error codes (e.g. image_too_large, too_many_images, multimodal_payload_too_large) instead of generic Param Incorrect.
  4. 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)

NMDX0721 avatar Sep 24 '26 14:09 NMDX0721

Closing as duplicate of #2535 (created moments earlier with the same content).

NMDX0721 avatar Sep 24 '26 14:09 NMDX0721