fix(classifier): extract body.param for Xiaomi MiMo error#42244
Open
diogochubatsu wants to merge 1 commit into
Open
fix(classifier): extract body.param for Xiaomi MiMo error#42244diogochubatsu wants to merge 1 commit into
diogochubatsu wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Xiaomi MiMo API returns errors with the diagnostic in a top-level
paramfield rather than inmessage:{"code":"400","message":"Param Incorrect","param":"`text` is not set"}The error classifier only extracted
body.message(Param Incorrect) but NOTbody.param(`text` is not set). This caused themultimodal_tool_content_unsupportedpattern to never match, resulting in the error being classified as a non-retryableformat_errorand aborting the session.Fix
Added extraction of
body.paraminto theerror_msgused for pattern matching. Now the`text` is not setpattern correctly triggers the multimodal tool content recovery path (strip images from tool messages and retry).Before
After
Testing
Verified that the pattern matching works with the exact error from the user's session:
Fixes #27344