fix(provider): clamp Xiaomi MiMo public reasoning tiers - #1485
Conversation
📝 WalkthroughWalkthroughAdds a Xiaomi MiMo OpenAI Chat provider preset with the ChangesXiaomi MiMo provider integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ProviderRegistry
participant LoginProviderConfiguration
participant ChatAdapter
ProviderRegistry->>LoginProviderConfiguration: configure Xiaomi MiMo endpoint and mimo-v2.5
LoginProviderConfiguration->>ChatAdapter: route OpenAI Chat requests
ChatAdapter-->>LoginProviderConfiguration: map reasoning effort to low, medium, or high
LoginProviderConfiguration-->>ProviderRegistry: preserve custom destination when configured
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
|
Exact-head CI follow-up for
All Linux shards, gates, macOS, API/storage, keyring, npm-global, React Doctor, hygiene, and target checks are therefore green on the exact PR head. No GUI or unrelated timeout change was added to this provider patch. The PR remains draft and unmerged pending independent maintainer review. |
Wibias
left a comment
There was a problem hiding this comment.
Reviewed the Xiaomi MiMo reasoning-contract change. I did not find an additional blocker in this scoped head. The fixed-destination preset limits the advertised ladder to low/medium/high, clamps higher direct tiers to high, and preserveCustomDestination protects same-named custom providers on other origins.
The separately reported malformed delta.tool_calls failure in #1483 is intentionally not repaired here and should remain tracked independently. I am not approving this head because it is currently not mergeable against the latest dev; rebase/resolve conflicts and request re-review.
945d171 to
f65dcae
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs-site/src/content/docs/guides/providers.md`:
- Line 294: Document Xiaomi MiMo’s reasoning contract alongside the provider
entry: state that only low, medium, and high are supported, and that xhigh, max,
and ultra are clamped to high. Apply the equivalent localized note in
docs-site/src/content/docs/ja/guides/providers.md:221,
docs-site/src/content/docs/ko/guides/providers.md:221,
docs-site/src/content/docs/ru/guides/providers.md:232,
docs-site/src/content/docs/zh-cn/guides/providers.md:209, and
docs-site/src/content/docs/zh-tw/guides/providers.md:275, while adding the
base-language note in docs-site/src/content/docs/guides/providers.md:294.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5c3e0737-3722-4414-aa42-1093b639e040
📒 Files selected for processing (10)
docs-site/src/content/docs/guides/providers.mddocs-site/src/content/docs/ja/guides/providers.mddocs-site/src/content/docs/ko/guides/providers.mddocs-site/src/content/docs/ru/guides/providers.mddocs-site/src/content/docs/zh-cn/guides/providers.mddocs-site/src/content/docs/zh-tw/guides/providers.mdsrc/providers/registry.tsstructure/03_catalog-and-subagents.mdtests/mimo-token-plan-provider.test.tstests/provider-registry-parity.test.ts
| | SiliconFlow | `https://api.siliconflow.cn/v1` | | ||
| | Volcengine Ark · Coding Plan · Agent Plan | `https://ark.cn-beijing.volces.com/api/v3` · `https://ark.cn-beijing.volces.com/api/coding/v3` · `https://ark.cn-beijing.volces.com/api/plan/v3` | | ||
| | Xiaomi MiMo | `https://api.xiaomimimo.com/anthropic` | | ||
| | Xiaomi MiMo (OpenAI Chat) | `https://api.xiaomimimo.com/v1` | |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Document the Xiaomi MiMo reasoning contract.
The new rows identify the endpoint, but they do not state that Xiaomi MiMo supports only low, medium, and high. They also do not state that xhigh, max, and ultra are clamped to high. Users can otherwise select a tier that the CLI silently changes.
docs-site/src/content/docs/guides/providers.md#L294-L294: Add the supported ladder and clamping behavior.docs-site/src/content/docs/ja/guides/providers.md#L221-L221: Add the equivalent localized behavior note.docs-site/src/content/docs/ko/guides/providers.md#L221-L221: Add the equivalent localized behavior note.docs-site/src/content/docs/ru/guides/providers.md#L232-L232: Add the equivalent localized behavior note.docs-site/src/content/docs/zh-cn/guides/providers.md#L209-L209: Add the equivalent localized behavior note.docs-site/src/content/docs/zh-tw/guides/providers.md#L275-L275: Add the equivalent localized behavior note.
As per path instructions, user-facing docs must stay in sync with actual CLI/API behavior. The referenced adapter documentation also requires consistent documentation of provider-specific reasoning support and higher-tier clamping.
📍 Affects 6 files
docs-site/src/content/docs/guides/providers.md#L294-L294(this comment)docs-site/src/content/docs/ja/guides/providers.md#L221-L221docs-site/src/content/docs/ko/guides/providers.md#L221-L221docs-site/src/content/docs/ru/guides/providers.md#L232-L232docs-site/src/content/docs/zh-cn/guides/providers.md#L209-L209docs-site/src/content/docs/zh-tw/guides/providers.md#L275-L275
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@docs-site/src/content/docs/guides/providers.md` at line 294, Document Xiaomi
MiMo’s reasoning contract alongside the provider entry: state that only low,
medium, and high are supported, and that xhigh, max, and ultra are clamped to
high. Apply the equivalent localized note in
docs-site/src/content/docs/ja/guides/providers.md:221,
docs-site/src/content/docs/ko/guides/providers.md:221,
docs-site/src/content/docs/ru/guides/providers.md:232,
docs-site/src/content/docs/zh-cn/guides/providers.md:209, and
docs-site/src/content/docs/zh-tw/guides/providers.md:275, while adding the
base-language note in docs-site/src/content/docs/guides/providers.md:294.
Source: Path instructions
Wibias
left a comment
There was a problem hiding this comment.
Re-review against current dev@e8db4e03: the implementation correctly limits Xiaomi MiMo to low/medium/high and clamps xhigh/max/ultra to high, but the user-facing provider guides only add the endpoint row and omit that behavior. Since users can otherwise select a tier that OpenCodex silently lowers, please document the supported ladder and clamping behavior in the base guide and the five localized provider guides touched by this PR. The branch is also 9 commits behind current dev and currently not mergeable, so please rebase after the docs fix.
Summary
xiaomi-mimopreset for Xiaomi's official OpenAI-compatible Chat endpointlow,medium, andhighreasoning tiersxhigh,max, andultrarequests tohighRoot cause and impact
https://api.xiaomimimo.com/v1had no registry-owned transport contract. A custom provider namedxiaomi-mimotherefore kept the generic routed-model ladder and could advertise/sendmaxeven though the MiMo endpoint rejects every reasoning value abovehigh.The new preset is intentionally separate from the existing Xiaomi Anthropic and MiMo token-plan entries because those routes use different hosts and transport contracts.
preserveCustomDestinationprevents the preset from retargeting an existing custom key when a same-named row points somewhere else.This PR does not normalize the separately reported malformed
delta.tool_callsfailure. The shared parser remains fail-closed until a redacted failing frame identifies the actual nested shape; guessing there could silently drop or mis-bind a tool call.Refs #1483.
Provider evidence
Verified from Xiaomi's primary sources on 2026-08-11:
POST https://api.xiaomimimo.com/v1/chat/completionsand API-key/Bearer authentication.Xiaomi Technologies Singapore Pte. Ltd.as the API service operator outside mainland China; the agreement was updated 2026-07-07.@Ingwannu. Endpoint/auth/catalog breakage should be reported in the OpenCodex issue tracker and will be rechecked against the primary sources above.GET /v1/modelscontract is claimed.Verification
bun test tests/mimo-token-plan-provider.test.ts tests/provider-registry-parity.test.ts— 41 passedbun test tests/provider-workspace-rail.test.ts— 6 passed after installing the GUI workspace dependenciesbun run typecheck— passedbun run privacy:scan— passedcd docs-site && bun install --frozen-lockfile && bun run build— 265 pages builtbun run test— 11,047 passed, 11 skipped, 2 failed across 681 files; the failures were the live service-token environment collision incodex-shim.test.tsand a loaded-runner stall deadline inbridge-lifecycle.test.tsenv -u OPENCODEX_API_AUTH_TOKEN bun test tests/codex-shim.test.ts tests/bridge-lifecycle.test.ts— both failed files passed in isolation, 82/82git diff --check— passedChecklist
Scope notes
devonly.Summary by CodeRabbit
New Features
mimo-v2.5model with low, medium, and high reasoning levels.Documentation