Skip to content

[Bug]: MiniMax M2.5 tool calls have no effect — XML tool invocations are stripped instead of executed #41839

Description

@mqyang56

Bug type

Behavior bug (incorrect output/state without crash)

Summary

When opencode/minimax-m2.5 is set as the primary model, all tool calls are silently discarded. The agent never executes any tool, regardless of the request.

Steps to reproduce

  1. Configure primary model as opencode/minimax-m2.5 in ~/.openclaw/openclaw.json:
    { "agents": { "defaults": { "model": { "primary": "opencode/minimax-m2.5" } } } }
  2. Start a session and send a message that requires tool use (e.g., a web search or file read).
  3. Observe that the agent replies without invoking any tool.

Expected behavior

Tool calls issued by the model are parsed and executed; results are returned to the model and a final reply is produced.

Actual behavior

No tools are executed. The agent replies as if tools do not exist.

Root cause (code-level)

MiniMax M2.5 does not emit standard tool_use blocks. Instead it embeds tool invocations as XML in text content:

<minimax:tool_call>
<invoke name="some_tool">...</invoke>
</minimax:tool_call>

stripMinimaxToolCallXml() in src/agents/pi-embedded-utils.ts removes this XML from the text — but never parses or dispatches it as a tool execution. The invocation is silently dropped.

Relevant code:

  • src/agents/pi-embedded-utils.tsstripMinimaxToolCallXml() + extractAssistantText()
  • src/agents/opencode-zen-models.ts:99 — MiniMax routed to anthropic-messages API, but format does not conform

OpenClaw version

2026.3.9 (5decb00)

Operating system

macOS 25.3.0

Install method

pnpm dev

Impact and severity

Affected: All users with opencode/minimax-m2.5 as primary model
Severity: High — tools are completely non-functional with this model
Frequency: 100% repro
Consequence: Agent cannot use any tools; renders the model effectively useless for agentic tasks

Additional information

Workaround: switch primary model to one with proper tool_use support, e.g.:

openclaw config set agents.defaults.model.primary opencode/claude-opus-4-6

Fix direction: parse <invoke name="...">...</invoke> XML in MiniMax output and dispatch as structured tool calls, rather than stripping. Requires changes in pi-embedded-utils.ts and pi-embedded-subscribe.handlers.ts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions