Bug Report: MiniMax Tool Call Compatibility Issue (Windows Only) #7913

Open
opened 2026-02-16 18:08:39 -05:00 by yindo · 3 comments
Owner

Originally created by @menglongyuan on GitHub (Jan 28, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Description

When using OpenCode on Windows, the client fails to correctly parse and execute tool calls returned by a privately deployed MiniMax model (SGlang backend, HTTP connection). This issue does not occur on Linux clients.

Background

  • MiniMax is deployed on-premises (private cloud, not SaaS), using SGlang as the backend engine.
  • The OpenCode client communicates with MiniMax via HTTP (not HTTPS).
  • MiniMax returns tool call information in a non-standard XML format embedded in the content field, e.g.:
{
  "message": {
    "content": "...<minimax:tool_call>\n<invoke name=\"list_dir\">\n<parameter name=\"path\">...</parameter>\n</invoke>\n</minimax:tool_call>"
  },
  "finish_reason": "stop"
}
  • The OpenAI-compatible format expected by OpenCode is:
{
  "message": {
    "content": null,
    "tool_calls": [{
      "id": "call_abc123",
      "type": "function",
      "function": {
        "name": "list_dir",
        "arguments": "{\"path\": \"...\"}"
      }
    }]
  },
  "finish_reason": "tool_calls"
}

Problem Details

  • Tool call info is embedded in content as XML, not in a tool_calls array.
  • finish_reason is stop instead of tool_calls.
  • function.arguments should be a JSON string, not an object or XML.
  • This causes OpenCode on Windows to not trigger tool execution, while Linux clients work as expected.

Steps to Reproduce

  1. Deploy MiniMax (SGlang backend) in a private environment, accessible via HTTP.
  2. Connect OpenCode client (Windows) to the MiniMax endpoint.
  3. Trigger a tool call (e.g., ask the model to list a directory).
  4. Observe that the tool call is not executed automatically on Windows, but works on Linux.

Impact

  • Windows OpenCode users cannot use tool call automation with MiniMax (SGlang) backend.
  • Linux OpenCode users are not affected.
  • This blocks cross-platform automation and workflow consistency.

Additional Technical Notes

  • The issue is not related to network or authentication; only the response format is problematic.
  • A Python/Go middleware can be used to convert MiniMax XML tool calls to OpenAI-compatible JSON (see internal doc for code).
  • The bug is likely in the Windows OpenCode client’s tool call parsing logic.
  • MiniMax is running in a secure, private network (not public cloud).

Expected Behavior

OpenCode should correctly parse and execute tool calls from MiniMax (SGlang backend) on all platforms (Windows and Linux), regardless of HTTP/HTTPS or deployment type.

Contact

For more details, test cases, or code samples, please contact the reporter.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @menglongyuan on GitHub (Jan 28, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description ## Description When using OpenCode on Windows, the client fails to correctly parse and execute tool calls returned by a privately deployed MiniMax model (SGlang backend, HTTP connection). This issue does **not** occur on Linux clients. ## Background - **MiniMax is deployed on-premises** (private cloud, not SaaS), using SGlang as the backend engine. - The OpenCode client communicates with MiniMax via HTTP (not HTTPS). - MiniMax returns tool call information in a non-standard XML format embedded in the `content` field, e.g.: ```json { "message": { "content": "...<minimax:tool_call>\n<invoke name=\"list_dir\">\n<parameter name=\"path\">...</parameter>\n</invoke>\n</minimax:tool_call>" }, "finish_reason": "stop" } ``` - The OpenAI-compatible format expected by OpenCode is: ```json { "message": { "content": null, "tool_calls": [{ "id": "call_abc123", "type": "function", "function": { "name": "list_dir", "arguments": "{\"path\": \"...\"}" } }] }, "finish_reason": "tool_calls" } ``` ## Problem Details - **Tool call info is embedded in `content` as XML, not in a `tool_calls` array.** - **`finish_reason` is `stop` instead of `tool_calls`.** - **`function.arguments` should be a JSON string, not an object or XML.** - This causes OpenCode on Windows to not trigger tool execution, while Linux clients work as expected. ## Steps to Reproduce 1. Deploy MiniMax (SGlang backend) in a private environment, accessible via HTTP. 2. Connect OpenCode client (Windows) to the MiniMax endpoint. 3. Trigger a tool call (e.g., ask the model to list a directory). 4. Observe that the tool call is not executed automatically on Windows, but works on Linux. ## Impact - **Windows OpenCode users cannot use tool call automation with MiniMax (SGlang) backend.** - **Linux OpenCode users are not affected.** - This blocks cross-platform automation and workflow consistency. ## Additional Technical Notes - The issue is not related to network or authentication; only the response format is problematic. - A Python/Go middleware can be used to convert MiniMax XML tool calls to OpenAI-compatible JSON (see internal doc for code). - The bug is likely in the Windows OpenCode client’s tool call parsing logic. - MiniMax is running in a secure, private network (not public cloud). ## Expected Behavior OpenCode should correctly parse and execute tool calls from MiniMax (SGlang backend) on **all platforms** (Windows and Linux), regardless of HTTP/HTTPS or deployment type. ## Contact For more details, test cases, or code samples, please contact the reporter. ### Plugins _No response_ ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the windowsbug labels 2026-02-16 18:08:39 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 28, 2026):

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

  • #10760: MiniMax-M2.1 fails with "cannot unmarshal string" - Related to MiniMax API compatibility issues
  • #8184: Strict JSON Schema validation fail on backends like SGLang - Related to SGLang backend tool parsing issues
  • #7185: When use gpt-oss-120B by vLLM locally, opencode doesn't call the tools - Related to tool calling failures with custom backends

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

@github-actions[bot] commented on GitHub (Jan 28, 2026): This issue might be a duplicate of existing issues. Please check: - #10760: MiniMax-M2.1 fails with "cannot unmarshal string" - Related to MiniMax API compatibility issues - #8184: Strict JSON Schema validation fail on backends like SGLang - Related to SGLang backend tool parsing issues - #7185: When use gpt-oss-120B by vLLM locally, opencode doesn't call the tools - Related to tool calling failures with custom backends Feel free to ignore if none of these address your specific case.
Author
Owner

@firewelly commented on GitHub (Jan 29, 2026):

Minimax M2.1, including the official API, generates multi-step plans under Windows but encounters issues during execution as the opencode is not recognized. This problem does not occur on Linux or MacOS.

@firewelly commented on GitHub (Jan 29, 2026): Minimax M2.1, including the official API, generates multi-step plans under Windows but encounters issues during execution as the opencode is not recognized. This problem does not occur on Linux or MacOS.
Author
Owner

@344303947 commented on GitHub (Feb 6, 2026):

The same issue occurs in local inference of MiniMax2.1 with vLLM.

@344303947 commented on GitHub (Feb 6, 2026): The same issue occurs in local inference of MiniMax2.1 with vLLM.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7913