-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Description
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
contentfield, 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
contentas XML, not in atool_callsarray. finish_reasonisstopinstead oftool_calls.function.argumentsshould 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
- Deploy MiniMax (SGlang backend) in a private environment, accessible via HTTP.
- Connect OpenCode client (Windows) to the MiniMax endpoint.
- Trigger a tool call (e.g., ask the model to list a directory).
- 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
Reactions are currently unavailable