Skip to content

MiniMax LLM Error (2013): Multiple system messages in requests #198

@DenXjun

Description

@DenXjun

Pre-checks

Deployment Method

Source (setup.sh)

Steps to Reproduce

Issue Description

When using the MiniMax LLM, the following error occurs in Agent-to-Agent communication and trigger execution scenarios:

HTTP 400: {"type":"error","error":{"type":"bad_request_error","message":"invalid params, invalid chat setting (2013)","http_code":"400"}}

Affected Features

  • Agent-to-Agent communication via Gateway
  • Automatic trigger execution

Reproduction Steps

  1. Configure an Agent using the MiniMax model
  2. Have another Agent send a message to this Agent (via Gateway)
    OR
    Configure an automatic trigger execution
  3. Observe the error message in backend.log

Expected vs Actual Behavior

Root Cause

The MiniMax LLM does not support multiple messages with the system role in the message list.

The issue exists in two files:

  1. app/api/gateway.py - During Agent-to-Agent communication
  2. app/services/trigger_daemon.py - During trigger execution

The code logic in both locations is as follows:

  1. Construct a complete context-aware system_prompt
  2. Add a system message to the messages list: {"role": "system", "content": system_prompt}
  3. Call call_llm(messages)
  4. The call_llm function internally adds another system message: api_messages = [LLMMessage(role="system", content=system_prompt)]

Result: The message list contains two system messages, which MiniMax rejects and returns error (2013).

Logs / Screenshots

2026-03-24 21:16:19 | ERROR | app.api.websocket:call_llm:262 - [LLM] LLMError provider=minimax model=MiniMax-M2.5 round=1: HTTP 400: {"type":"error","error":{"type":"bad_request_error","message":"invalid params, invalid chat setting (2013)","http_code":"400"}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions