Skip to content

fix(xiaomi): pass thinking param to MiMo API#27363

Open
zccyman wants to merge 1 commit into
NousResearch:mainfrom
atyou2happy:fix/mimo-thinking-param-27325
Open

fix(xiaomi): pass thinking param to MiMo API#27363
zccyman wants to merge 1 commit into
NousResearch:mainfrom
atyou2happy:fix/mimo-thinking-param-27325

Conversation

@zccyman

@zccyman zccyman commented May 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a custom Xiaomi provider profile class that emits extra_body.thinking to control MiMo thinking mode. When the user configures reasoning_effort: none or otherwise disables reasoning, sends thinking: {type: "disabled"} to prevent unnecessary token consumption.

Closes #27325

Problem

Xiaomi MiMo provider used a bare ProviderProfile with no overrides — the thinking parameter was never passed in API requests. MiMo defaults to thinking=enabled, consuming tokens on every request regardless of user config. Settings like reasoning_effort: none had no effect on the actual API call.

Solution

Replace the bare ProviderProfile with a XiaomiProfile subclass that overrides build_api_kwargs_extras, following the same pattern used by KimiProfile:

  • When reasoning_config.enabled is Falseextra_body.thinking = {type: "disabled"}
  • Otherwise → extra_body.thinking = {type: "enabled"}

Only 1 file changed (+45/-2).

Files Changed

# File Change
1 plugins/model-providers/xiaomi/__init__.py +45/-2: add XiaomiProfile class with build_api_kwargs_extras override for thinking param

Test Results

94 passed (related provider profile + Xiaomi tests)
0 regressions

Design Decisions

  • Follows Kimi pattern exactly — Kimi already uses the same extra_body.thinking approach via KimiProfile.build_api_kwargs_extras. Xiaomi uses the same OpenAI-compatible API format.
  • Minimal diff — no changes to transport, no new params, no legacy path changes. Only the provider profile needed updating.

@cardtest15-coder

This comment was marked as spam.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins provider/xiaomi Xiaomi MiLM labels May 17, 2026
@zccyman zccyman force-pushed the fix/mimo-thinking-param-27325 branch from ca2d16a to fe750d9 Compare May 18, 2026 00:36
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused Xiaomi provider fix. I verified the premise against current main: plugins/model-providers/xiaomi/__init__.py:6 still instantiates a bare ProviderProfile, while the chat-completions transport already calls profile.build_api_kwargs_extras(reasoning_config=...) and merges returned extra-body fields at agent/transports/chat_completions.py:527 and agent/transports/chat_completions.py:555.

Problems

  • The change currently has no Xiaomi-specific regression coverage. Current tests cover the analogous Kimi disable path at tests/providers/test_provider_profiles.py:78, but gh pr diff 27363 shows this PR only changes plugins/model-providers/xiaomi/__init__.py.

Suggested changes

  • Add a TestXiaomiProfile case in tests/providers/test_provider_profiles.py asserting reasoning_config={"enabled": False} produces extra_body["thinking"] == {"type": "disabled"} and no top-level kwargs.
  • Add a profile-path transport assertion similar to tests/providers/test_profile_wiring.py:77 proving the Xiaomi profile result lands in api_kwargs["extra_body"]["thinking"].

Overall this looks highly salvageable: the fix is in the right provider-profile layer and matches the existing transport hook. This is an automated hermes-sweeper review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins 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] Xiaomi MiMo provider does not pass thinking parameter — defaults to thinking-enabled, wasting tokens

4 participants