MiniMax M2 <think> tags #2662

Open
opened 2026-02-16 17:36:42 -05:00 by yindo · 13 comments
Owner

Originally created by @pskwr on GitHub (Nov 7, 2025).

Originally assigned to: @rekram1-node on GitHub.

Question

Does opencode support rendering tags in the UI like for example Claude Code?

Opencode:
Image

Claude Code:
Image

Originally created by @pskwr on GitHub (Nov 7, 2025). Originally assigned to: @rekram1-node on GitHub. ### Question Does opencode support rendering <think> tags in the UI like for example Claude Code? Opencode: <img width="721" height="402" alt="Image" src="https://github.com/user-attachments/assets/c299b75a-a5db-4c44-aa18-10c7eee2e20d" /> Claude Code: <img width="791" height="170" alt="Image" src="https://github.com/user-attachments/assets/73d505c4-b3ed-4b48-82c4-7cfd8e9ca55a" />
Author
Owner

@github-actions[bot] commented on GitHub (Nov 7, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3555: Deals specifically with MiniMax-M2 reasoning content and tags not being properly handled in OpenAI-compatible mode (closed)
  • #1528: General feature request for better support of thinking tags in local models with UI separation

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 7, 2025): This issue might be a duplicate of existing issues. Please check: - #3555: Deals specifically with MiniMax-M2 reasoning content and <think> tags not being properly handled in OpenAI-compatible mode (closed) - #1528: General feature request for better support of thinking tags in local models with UI separation Feel free to ignore if none of these address your specific case.
Author
Owner

@aaronnewsome commented on GitHub (Nov 7, 2025):

I'm using Minimax M2 on both their official API and locally hosted with llama.cpp. Both rendering the reasoning blocks properly in opencode, no think tags appear in the response texts. I set reasoning true in opencode.json

"models": {
        "minimax-m2": {
          "name": "minimax-m2",
          "tool_call": true,
          "reasoning": true,
          "cost": {
            "input": 0.10,
            "output": 1.20
          },
          "options": {
            "num_ctx": 131072,
            "temperature": 1.0,
            "top_p": 0.95,
            "top_k": 40
          }
        },

CORRECTION: I am using OpenCode with Minimax-M2 locally hosted only, not the official API. Using Minimax M2 official API with Claude Code.

@aaronnewsome commented on GitHub (Nov 7, 2025): I'm using Minimax M2 on <strike>both their official API and</strike> locally hosted with llama.cpp. Both rendering the reasoning blocks properly in opencode, no think tags appear in the response texts. I set reasoning true in opencode.json ``` "models": { "minimax-m2": { "name": "minimax-m2", "tool_call": true, "reasoning": true, "cost": { "input": 0.10, "output": 1.20 }, "options": { "num_ctx": 131072, "temperature": 1.0, "top_p": 0.95, "top_k": 40 } }, ``` CORRECTION: I am using OpenCode with Minimax-M2 locally hosted only, not the official API. Using Minimax M2 official API with Claude Code.
Author
Owner

@no1wudi commented on GitHub (Nov 7, 2025):

I'm using offical antropic API, opencode can't get correct title, but no "think" tags.

Image
@no1wudi commented on GitHub (Nov 7, 2025): I'm using offical antropic API, opencode can't get correct title, but no "think" tags. <img width="962" height="400" alt="Image" src="https://github.com/user-attachments/assets/60f0a3e3-a88b-4ddb-a98d-4aadeb7e377c" />
Author
Owner

@WAY29 commented on GitHub (Nov 18, 2025):

meet same error in unoffical codex relay... anyone can help?

@WAY29 commented on GitHub (Nov 18, 2025): meet same error in unoffical codex relay... anyone can help?
Author
Owner

@rekram1-node commented on GitHub (Nov 18, 2025):

what is codex relay?

@rekram1-node commented on GitHub (Nov 18, 2025): what is codex relay?
Author
Owner

@WAY29 commented on GitHub (Nov 18, 2025):

what is codex relay?

Oh, it means third-party intermediary website. It work well with the Codex CLI, but encountered some issues in OpenCode (can't render think blocks).

@WAY29 commented on GitHub (Nov 18, 2025): > what is codex relay? Oh, it means third-party intermediary website. It work well with the Codex CLI, but encountered some issues in OpenCode (can't render think blocks).
Author
Owner

@otarkhan commented on GitHub (Dec 5, 2025):

I'm using Minimax M2 on both their official API and locally hosted with llama.cpp. Both rendering the reasoning blocks properly in opencode, no think tags appear in the response texts. I set reasoning true in opencode.json

"models": {
        "minimax-m2": {
          "name": "minimax-m2",
          "tool_call": true,
          "reasoning": true,
          "cost": {
            "input": 0.10,
            "output": 1.20
          },
          "options": {
            "num_ctx": 131072,
            "temperature": 1.0,
            "top_p": 0.95,
            "top_k": 40
          }
        },

CORRECTION: I am using OpenCode with Minimax-M2 locally hosted only, not the official API. Using Minimax M2 official API with Claude Code.

@aaronnewsome Does tool calling work with OpenCode + local MiniMax-M2? I tested them but OpenCode doesn't parse/understand MiniMax's way of tool call (XML)

@otarkhan commented on GitHub (Dec 5, 2025): > I'm using Minimax M2 on both their official API and locally hosted with llama.cpp. Both rendering the reasoning blocks properly in opencode, no think tags appear in the response texts. I set reasoning true in opencode.json > > ``` > "models": { > "minimax-m2": { > "name": "minimax-m2", > "tool_call": true, > "reasoning": true, > "cost": { > "input": 0.10, > "output": 1.20 > }, > "options": { > "num_ctx": 131072, > "temperature": 1.0, > "top_p": 0.95, > "top_k": 40 > } > }, > ``` > > CORRECTION: I am using OpenCode with Minimax-M2 locally hosted only, not the official API. Using Minimax M2 official API with Claude Code. @aaronnewsome Does tool calling work with OpenCode + local MiniMax-M2? I tested them but OpenCode doesn't parse/understand MiniMax's way of tool call (XML)
Author
Owner

@aaronnewsome commented on GitHub (Dec 5, 2025):

I use OpenCode heavily with Minimax-M2 hosted locally. Over many weeks of heavy daily usage, I see no major issues and it runs very stable, much better than GLM 4.5. When someone says it doesn't work, my first two questions are, what are you serving it with and what chat template are you using. Details of my setup are here

https://github.com/ggml-org/llama.cpp/pull/16932#issuecomment-3583382087

@aaronnewsome commented on GitHub (Dec 5, 2025): I use OpenCode heavily with Minimax-M2 hosted locally. Over many weeks of heavy daily usage, I see no major issues and it runs very stable, much better than GLM 4.5. When someone says it doesn't work, my first two questions are, what are you serving it with and what chat template are you using. Details of my setup are here [https://github.com/ggml-org/llama.cpp/pull/16932#issuecomment-3583382087](https://github.com/ggml-org/llama.cpp/pull/16932#issuecomment-3583382087)
Author
Owner

@druellan commented on GitHub (Dec 6, 2025):

I'm using Minmax through nVidia NIM and I can see the tags showing as <think> and I think I saw them as _think_ one time. Seems to me there is a escaping/encode issue with some providers.

Image

V1.0.134 - Windows 10 - Windows Terminal

@druellan commented on GitHub (Dec 6, 2025): I'm using Minmax through nVidia NIM and I can see the tags showing as `<think>` and I think I saw them as `_think_` one time. Seems to me there is a escaping/encode issue with some providers. <img width="655" height="478" alt="Image" src="https://github.com/user-attachments/assets/24a7a883-17ec-4870-8559-431d3a1dcdfa" /> V1.0.134 - Windows 10 - Windows Terminal
Author
Owner

@letsrock85 commented on GitHub (Dec 25, 2025):

Image

Same issue. I suspect providers like OpenRouter run extra post-processing & parsing layers behind the scenes, which is why their outputs stay intact - unlike what I see when running the same model locally vLLM

@letsrock85 commented on GitHub (Dec 25, 2025): <img width="2117" height="1191" alt="Image" src="https://github.com/user-attachments/assets/8050ca35-c84b-4f19-aa5e-c841d4923d36" /> Same issue. I suspect providers like OpenRouter run extra post-processing & parsing layers behind the scenes, which is why their outputs stay intact - unlike what I see when running the same model locally vLLM
Author
Owner

@rekram1-node commented on GitHub (Dec 25, 2025):

the think tags are being sent as assistant messages not reasoning thats why opencode renders them as such

@rekram1-node commented on GitHub (Dec 25, 2025): the think tags are being sent as assistant messages not reasoning thats why opencode renders them as such
Author
Owner

@h14h commented on GitHub (Dec 30, 2025):

I'm trying to use MiniMax-M2.1 via the Fireworks API (using the default opencode auth setup) and running into this same issue. And not only are the <think> tags coming through as plaintext, but so are <minimax:tool_call> tags, which renders the model unusable.

AFAIK Fireworks does not have any equivalent to the reasoning_split flag that the official MiniMax API supports to ensure OpenAI SDK compatibility.

If feasible, it'd be awesome if OpenCode offered special support interleaved thinking models via the OpenAI-compatible API. The Fireworks-hosted M2.1 deployment is super appealing as a smart, inexpensive, high-TPS model, and I would love to not have to wait on Fireworks (or any other competing model provider) to figure out how to make these interleaved thinking models truly OpenAI compatible.

@h14h commented on GitHub (Dec 30, 2025): I'm trying to use MiniMax-M2.1 via the Fireworks API (using the default opencode auth setup) and running into this same issue. And not only are the `<think>` tags coming through as plaintext, but so are `<minimax:tool_call>` tags, which renders the model unusable. AFAIK Fireworks does not have any equivalent to the `reasoning_split` flag that the official [MiniMax API](https://platform.minimax.io/docs/api-reference/text-openai-api) supports to ensure OpenAI SDK compatibility. If feasible, it'd be awesome if OpenCode offered special support interleaved thinking models via the OpenAI-compatible API. The Fireworks-hosted M2.1 deployment is super appealing as a smart, inexpensive, high-TPS model, and I would love to not have to wait on Fireworks (or any other competing model provider) to figure out how to make these interleaved thinking models truly OpenAI compatible.
Author
Owner

@snipeship commented on GitHub (Jan 25, 2026):

@rekram1-node I think this issue can be closed

@snipeship commented on GitHub (Jan 25, 2026): @rekram1-node I think this issue can be closed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2662