Skip to content

OpenAI-compatible MiniMax responses leak <think> blocks into visible output instead of rendering them as thoughts #3387

@shenyankm

Description

@shenyankm

What happened?

When using MiniMax as a third-party provider in Qwen Code, thought rendering differs depending on which compatibility mode is used.

With the Anthropic-compatible MiniMax endpoint, thought content is displayed correctly in the dedicated thoughts UI.

With the OpenAI-compatible MiniMax endpoint, the model's reasoning content is exposed in the visible assistant output, including raw <think>...</think> blocks, instead of being parsed and rendered as thought-only content.

This causes inconsistent behavior across compatibility modes and leaks internal reasoning markup into the final visible reply.

Attached screenshots show:

  1. correct thought rendering with the Anthropic-compatible MiniMax endpoint
  2. incorrect visible <think>...</think> leakage with the OpenAI-compatible MiniMax endpoint

Before fix (OpenAI-compatible, incorrect behavior)
Image
Before fix (Anthropic-compatible, expected behavior)
Image

What did you expect to happen?

I expected MiniMax thoughts to be handled consistently across compatibility modes.

When MiniMax is configured through the OpenAI-compatible endpoint, Qwen Code should separate reasoning content the same way it does for the Anthropic-compatible endpoint, so that:

  • thought content is shown in the thoughts UI
  • raw <think>...</think> tags are not shown in the visible assistant response
  • the final visible answer contains only the user-facing reply

Client information

Image

Login information

API Config

MiniMax was configured as a third-party provider via modelProviders.

Example OpenAI-compatible configuration:

{
  "modelProviders": {
    "openai": [
      {
        "id": "MiniMax-M2.7",
        "name": "MiniMax M2.7",
        "envKey": "MINIMAX_API_KEY",
        "baseUrl": "https://api.minimaxi.com/v1"
      }
    ]
  },
  "security": {
    "auth": {
      "selectedType": "openai"
    }
  },
  "model": {
    "name": "MiniMax-M2.7"
  }
}

Anything else we need to know?

Reproduction steps:

  1. Configure MiniMax using the Anthropic-compatible endpoint.
  2. Start Qwen Code and send a prompt that reliably triggers reasoning output.
  3. Observe that thought content is displayed correctly in the thoughts UI.
  4. Reconfigure the same MiniMax model using the OpenAI-compatible endpoint.
  5. Start Qwen Code again and send the same prompt.
  6. Observe that the response leaks raw <think>...</think> content into the visible assistant output.

I attached screenshots showing the difference between the two modes.

This was reproduced using the same MiniMax model and the same API key. The only change between the two tests was the compatibility endpoint / base URL:

  • Anthropic-compatible: https://api.minimaxi.com/anthropic
  • OpenAI-compatible: https://api.minimaxi.com/v1

I only tested this with MiniMax, so I have not verified whether the same issue affects other OpenAI-compatible third-party providers.

I have already fixed this locally for MiniMax-specific handling of this issue. An additional screenshot of the OpenAI-compatible flow after the local fix is attached below for reference.

After local fix (OpenAI-compatible)

After local fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/needs-triageIssue needs to be triaged and labeledtype/bugSomething isn't working as expected

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions