Skip to content

[Compatibility] Xiaomi MiMo v2.5 fails on 2.12.0 with invalid tool calls and an incorrect reasoning ladder #1483

Description

@MAOKO1993

Client or integration

Codex App

Provider or upstream service

Xiaomi MiMo

OpenCodex version

2.12.0

Endpoint or capability

/v1/chat/completions · streaming tool calls · reasoning_effort

Current behaviour

On OpenCodex 2.12.0, Codex App cannot complete even a plain-text turn through a custom Xiaomi MiMo provider using the official OpenAI-compatible Chat endpoint.

Two failures are reproducible:

  1. The generated Codex catalog advertises low, medium, high, xhigh, max, and ultra for xiaomi-mimo/mimo-v2.5. Selecting max sends that value upstream, but MiMo rejects it because the endpoint only accepts none, low, medium, or high.
  2. After switching the same thread to medium, the request streams for several seconds and then OpenCodex terminates it with upstream response contained invalid tool calls.

No assistant message is delivered to Codex App. This reproduces with the plain prompt: 晚上好,你用的什么模型 ("Good evening, which model are you?").

Expected behaviour

A plain-text Codex App turn through xiaomi-mimo/mimo-v2.5 should complete with a visible assistant response.

The catalog must not advertise reasoning efforts that the selected Xiaomi endpoint rejects. If the endpoint supports only up to high, higher Codex effort labels should either be omitted or safely clamped according to an explicit provider contract.

If MiMo emits a non-conforming tool_calls streaming frame, OpenCodex should preserve the fail-closed behavior but provide enough redacted diagnostics to identify the incompatible nested shape, and apply a provider-specific normalization only when it is semantically safe.

Minimal redacted request or reproduction

Redacted provider configuration:


{
  "providers": {
    "xiaomi-mimo": {
      "adapter": "openai-chat",
      "baseUrl": "https://api.xiaomimimo.com/v1",
      "authMode": "key",
      "defaultModel": "mimo-v2.5",
      "liveModels": true,
      "disabled": false
    }
  }
}


Steps:

1. Start OpenCodex 2.12.0 on macOS and sync the catalog into Codex App.
2. Select `xiaomi-mimo/mimo-v2.5`.
3. Set reasoning effort to `max` and send: `晚上好,你用的什么模型`.
4. Observe the upstream 400 validation error.
5. Roll back the failed turn, set effort to `medium`, and send the same prompt.
6. Observe that the stream ends with `upstream response contained invalid tool calls`.

Codex App version observed: `0.147.0-alpha.6.5`.
No credentials, account identifiers, or request bodies containing secrets are included.

Actual response or error

With `reasoning_effort=max`:


Provider error 400: prefill failed: Input should be 'none', 'low', 'medium' or 'high'; input: 'max'


With `reasoning_effort=medium`:


stream disconnected before completion: Provider stream error: upstream response contained invalid tool calls


The exact malformed upstream `delta.tool_calls` shape is not persisted in the Codex session log, so this report does not claim whether it was a non-array value, a null element, or another invalid nested shape.

Upstream documentation

Xiaomi MiMo OpenAI-compatible Chat API:
https://platform.xiaomimimo.com/docs/en-US/api/chat/openai-api

OpenCodex issue #1325 documents the new fail-closed nested tool_calls validation and explicitly notes that no live provider evidence was available at filing time:
#1325

Suggested mapping or implementation notes

  • Add or reuse a registry-owned contract for the official public Xiaomi endpoint https://api.xiaomimimo.com/v1.
  • Advertise only low, medium, and high, or map xhigh/max/ultra to high, matching the existing MiMo token-plan compatibility contract where appropriate.
  • Capture the invalid nested field category in redacted provider diagnostics without recording tool arguments or credentials.
  • Add a live-route or deterministic adapter regression case for MiMo streaming tool-call frames.
  • Do not silently drop a claimed tool call; normalize only a documented benign provider shape.

Additional context and attachments

Regression evidence:

  • The same custom provider and xiaomi-mimo/mimo-v2.5 completed Codex App turns successfully on OpenCodex 2.10.1.
  • The current failure was reproduced repeatedly on 2.12.0 with both max and medium.
  • No existing issue matched the repository search: mimo "invalid tool calls".

Related:

Checks

  • I searched existing provider and compatibility issues.
  • The request and response were redacted.
  • The expected behaviour is based on an upstream specification or a concrete client requirement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    providerProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reportstoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions