Bug Description
MiniMax M3 rejects an existing OpenCode session after switching the session from another model to opencode-go/minimax-m3.
The failure happens only in sessions that already contain tool-call/tool-result history. A fresh MiniMax M3 session works.
Provider error:
invalid params, tool call result does not follow tool call (2013)
Expected Behavior
Switching a tool-heavy existing session to MiniMax M3 should either work or send a provider-compatible transcript. Historical tool-call/tool-result context should not cause MiniMax to reject the request before generation starts.
Current Behavior
OpenCode sends the old tool transcript to opencode-go/minimax-m3; MiniMax validates the tool sequence strictly and returns HTTP 400.
Reproduction Steps
- Use an OpenCode session with prior tool use, for example reads/greps/shell calls.
- Continue the same session using
opencode-go/minimax-m3.
- Send a normal user message.
- The request fails with HTTP 400 from MiniMax.
I verified that a fresh MiniMax M3 session succeeds with a simple prompt, so this is tied to prior tool history in the session.
Possible Solution
Flatten historical tool-call/tool-result parts to plain text for MiniMax before provider serialization. This keeps the transcript context while avoiding MiniMax strict tool-result sequencing validation. Current-turn tools can remain enabled.
Additional Info
Observed provider endpoint: https://opencode.ai/zen/go/v1/messages.
Bug Description
MiniMax M3 rejects an existing OpenCode session after switching the session from another model to
opencode-go/minimax-m3.The failure happens only in sessions that already contain tool-call/tool-result history. A fresh MiniMax M3 session works.
Provider error:
Expected Behavior
Switching a tool-heavy existing session to MiniMax M3 should either work or send a provider-compatible transcript. Historical tool-call/tool-result context should not cause MiniMax to reject the request before generation starts.
Current Behavior
OpenCode sends the old tool transcript to
opencode-go/minimax-m3; MiniMax validates the tool sequence strictly and returns HTTP 400.Reproduction Steps
opencode-go/minimax-m3.I verified that a fresh MiniMax M3 session succeeds with a simple prompt, so this is tied to prior tool history in the session.
Possible Solution
Flatten historical tool-call/tool-result parts to plain text for MiniMax before provider serialization. This keeps the transcript context while avoiding MiniMax strict tool-result sequencing validation. Current-turn tools can remain enabled.
Additional Info
Observed provider endpoint:
https://opencode.ai/zen/go/v1/messages.