Skip to content

fix(vision): add Xiaomi MiMo 'text is not set' to image rejection phrases - #31042

Closed
vanhci wants to merge 3 commits into
NousResearch:mainfrom
vanhci:fix/mimo-vision-text-not-set
Closed

fix(vision): add Xiaomi MiMo 'text is not set' to image rejection phrases#31042
vanhci wants to merge 3 commits into
NousResearch:mainfrom
vanhci:fix/mimo-vision-text-not-set

Conversation

@vanhci

@vanhci vanhci commented May 23, 2026

Copy link
Copy Markdown

Summary

Adds Xiaomi MiMo's "text is not set" error pattern to the list so the agent strips images from user messages and retries in text-only mode.

Problem

MiMo v2.5 supports vision but rejects multimodal requests where the text content part is missing with HTTP 400:

Without this fix, the agent cascades into compression or context-overflow recovery instead of the correct image-stripping path.

Fix

  • Add "text is not set" and its backtick variant "text is not set" to in
  • Add corresponding test case to

Testing

  • All existing tests pass
  • New test verifies the pattern matches

Context

This error was observed when using MiMo v2.5 as the primary model with tool (screenshot analysis). The agent sends multimodal requests with image_url content parts, but MiMo requires a text content part to be present.

Vanhci and others added 3 commits May 21, 2026 22:06
WeChat adapter's secondary content-fingerprint dedup was dropping
intentionally-repeated slash commands (e.g. /approve sent twice). The
dedup layer now skips text starting with '/', allowing commands to be
processed regardless of prior dedup state.

Fixes #29779
…ases

MiMo v2.5 supports vision but rejects multimodal requests where the
text content part is missing with HTTP 400:
  {'error': {'code': '400', 'message': 'Param Incorrect',
             'param': 'text is not set'}}

Add this error pattern (and its backtick variant) to the
_IMAGE_REJECTION_PHRASES list so the agent strips images from user
messages and retries in text-only mode, instead of cascading into
compression or context-overflow recovery.

Refs: #27344

@jsboige jsboige left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean fix with bonus weixin dedup improvement. Two separate changes:

  1. Xiaomi MiMo vision rejection: Adds text is not set and backtick variant to image rejection phrases. Correct — MiMo rejects image-only requests where no text content part is present. Test coverage includes both variants and a false-negative check. Good.

  2. WeChat command dedup bypass: Commands starting with / skip content-fingerprint dedup. Fixes silent dropping of intentionally-repeated slash commands like /approve. Small, targeted, correct.

LGTM.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have provider/xiaomi Xiaomi MiLM comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint platform/wecom WeCom / WeChat Work adapter labels May 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #30682 (same MiMo "text is not set" error). Note: #30259 (merged) already adds reactive recovery for providers rejecting list-type tool content — it strips image parts on failure and retries. This PR adds the error string to the proactive image-rejection phrases list as a complementary fix. Also includes an unrelated WeChat slash-command dedup fix in weixin.py.

@vanhci vanhci closed this by deleting the head repository May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P3 Low — cosmetic, nice to have platform/wecom WeCom / WeChat Work adapter provider/xiaomi Xiaomi MiLM type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants