Skip to content

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

@menglongyuan

Description

@menglongyuan

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions