Skip to content

fix(classifier): extract body.param for Xiaomi MiMo error#42244

Open
diogochubatsu wants to merge 1 commit into
NousResearch:mainfrom
diogochubatsu:fix/xiaomi-mimo-text-is-not-set
Open

fix(classifier): extract body.param for Xiaomi MiMo error#42244
diogochubatsu wants to merge 1 commit into
NousResearch:mainfrom
diogochubatsu:fix/xiaomi-mimo-text-is-not-set

Conversation

@diogochubatsu

Copy link
Copy Markdown

Problem

The Xiaomi MiMo API returns errors with the diagnostic in a top-level param field rather than in message:

{"code":"400","message":"Param Incorrect","param":"`text` is not set"}

The error classifier only extracted body.message (Param Incorrect) but NOT body.param (`text` is not set). This caused the multimodal_tool_content_unsupported pattern to never match, resulting in the error being classified as a non-retryable format_error and aborting the session.

Fix

Added extraction of body.param into the error_msg used for pattern matching. Now the `text` is not set pattern correctly triggers the multimodal tool content recovery path (strip images from tool messages and retry).

Before

error_msg = "badrequesterror [http 400] param incorrect"
# Pattern "text is not set" NOT found → classified as format_error → non-retryable → ABORT

After

error_msg = "badrequesterror [http 400] param incorrect `text` is not set"
# Pattern "`text` is not set" FOUND → classified as multimodal_tool_content_unsupported → retryable → strip images + RETRY

Testing

Verified that the pattern matching works with the exact error from the user's session:

error_msg = 'badrequesterror [http 400] param incorrect `text` is not set'
pattern = '`text` is not set'
assert pattern in error_msg  # True

Fixes #27344

Xiaomi MiMo API puts diagnostic info in body.param field.
Without extracting it, multimodal tool content errors are
misclassified as non-retryable format errors.

Fixes the 'text is not set' error causing session abort.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent loop, run_agent.py, prompt builder provider/xiaomi Xiaomi MiLM labels Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P3 Low — cosmetic, nice to have provider/xiaomi Xiaomi MiLM type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] computer_use multimodal tool message causes 400 error on providers that don't support multimodal tool content (e.g. Xiaomi MiMo)

2 participants