Trae 团队您好,
我在使用 Trae 接入自定义模型 mimo-v2.5-pro 时遇到一个问题:
第二次对话会稳定报错 “Param Incorrect (Model Provider Error Code: 400)”。
更多日志可提供
Bug 报告:Trae 接入 mimo-v2.5-pro 第二次对话报错 400
基本信息
项目
内容
报告日期
2026-05-13
Trae 版本
3.3.57 (stable)
操作系统
Windows 11 Home China
模型
mimo-v2.5-pro (自定义 OpenAI 兼容)
模型提供商
小米 mimo (token-plan-cn.xiaomimimo.com)
问题严重程度
高 - 导致无法正常使用自定义模型
问题描述
在 Trae IDE 中使用 mimo-v2.5-pro 作为自定义模型时,第二次及后续对话会稳定报错:
Param Incorrect (Model Provider Error Code: 400, HTTP Status: 400)
第一次对话正常,第二次对话必现此错误。
复现步骤
-
在 Trae 设置中添加自定义模型 mimo-v2.5-pro
-
Base URL:
https://token-plan-cn.xiaomimimo.com/v1/chat/completions -
Model Name:
mimo-v2.5-pro
-
-
新建一个 Builder/Agent 会话,发送第一条消息 → 正常响应
-
在同一会话中发送第二条消息 → 报错 400
-
错误稳定复现,每次必现
日志分析
错误链路(来自 ai-agent stdout 日志)
14:50:28.330 INFO [HTTP] POST /api/agent/v3/create_agent_task, body_len=35852
14:50:28.487 INFO [HTTP] Response: 200 OK (Trae API 正常)
14:50:28.506 INFO [ModelConfig] Received config_name=mimo-v2.5-pro
14:50:28.542 INFO History: HistoryEvent { ... } // 包含历史消息
14:50:29.323 ERROR custom_model_proxy_client: HTTP request failed with status: 400
14:50:29.393 ERROR [AhaNetHTTPClient/Stream][Error] error: ErrorEvent {
message: "Param Incorrect (Model Provider Error Code: 400, HTTP Status: 400)",
code: 4028 }
14:50:29.398 ERROR plan llm error: ErrorEvent {
message: "Param Incorrect (Model Provider Error Code: 400, HTTP Status: 400)",
code: 4028 }
关键发现
-
Trae 服务端正常:
create_agent_task返回 200 OK -
错误发生在 mimo 端:自定义模型代理向
token-plan-cn.xiaomimimo.com发送请求后返回 400 -
第二次对话时历史消息格式问题:
-
第一次对话:正常发送用户输入
-
第二次对话:发送的消息包含
HistoryEvent,其中raw_messages包含:-
<system-reminder>标签内容 -
<available_terminal>标签内容 -
之前对话的完整上下文
-
-
消息格式为
content数组(多个{"type":"text","text":"..."})
-
疑似根因
mimo 模型可能不完全支持 OpenAI 兼容 API 的所有消息格式,特别是:
-
content为数组格式:{ "role": "user", "content": [ {"type": "text", "text": "<system-reminder>..."}, {"type": "text", "text": "<system-reminder>..."} ] } -
包含特殊标签的历史消息:
<system-reminder>、<available_terminal>等 Trae 内部标签 -
toolrole 和tool_call结构(SOLO Agent 模式特有)
已尝试的解决方案
方案
结果
卸载部分 Skills(减少请求体大小)
无效,55KB → 36KB,错误依旧
新建会话
临时规避,但无法在同一会话中多轮对话
建议修复方向
方案 1:简化历史消息格式(推荐)
在发送给自定义模型前,将消息格式转换为简单字符串格式:
// 当前格式(可能导致 400)
{
"role": "user",
"content": [
{"type": "text", "text": "..."},
{"type": "text", "text": "..."}
]
}
// 建议格式
{
"role": "user",
"content": "合并后的文本内容"
}
方案 2:自定义模型兼容模式
在模型设置中增加选项:
-
简化消息格式(兼容旧版/自研模型)
-
过滤系统内部标签
-
使用纯文本模式(禁用 tool_call)
方案 3:针对特定模型的适配
检测到 mimo-v2.5-pro 时,自动:
-
合并
content数组为字符串 -
移除
<system-reminder>等内部标签 -
简化消息结构
附件
相关日志文件
文件
路径
说明
ai-agent stdout
20260513T144934\Modular\ai-agent_0_1778654974230_stdout.log
完整错误链路,第 13604-13619 行
ai-agent stdout
20260513T135502\Modular\ai-agent_0_1778651703072_stdout.log
首次发现错误,第 48661 行
renderer log
20260513T144934\window1\renderer.log
前端错误事件
关键日志片段
# 错误发生位置
13604: INFO POST /api/agent/v3/create_agent_task, body_len=35852
13605: INFO Response: 200 OK
13608: INFO [ModelConfig] Received config_name=mimo-v2.5-pro
13609: INFO History: HistoryEvent { raw_messages: [{"role":"user","content":[{"type":"text","text":"\n<system-reminder>..."}]}
13611: ERROR custom_model_proxy_client::default_handler: HTTP request failed with status: 400
13613: ERROR [AhaNetHTTPClient/Stream][Error] error: ErrorEvent { message: "Param Incorrect (Model Provider Error Code: 400, HTTP Status: 400)", code: 4028 }
13618: ERROR plan llm error: ErrorEvent { message: "Param Incorrect (Model Provider Error Code: 400, HTTP Status: 400)", code: 4028 }
联系信息
-
报告者:Trae 用户
-
联系方式:(请填写)
附录:模型配置信息
{
"provider": "custom_openai_compatible",
"config_name": "custom_openai_compatible//mimo-v2.5-pro",
"model_name": "custom_openai_compatible//mimo-v2.5-pro",
"display_model_name": "mimo-v2.5-pro",
"base_url": "https://token-plan-cn.xiaomimimo.com/v1/chat/completions",
"multimodal": true,
"prompt_max_tokens": 184000,
"max_tokens": 16000,
"max_turn": 200
}
el Provider Error Code: 400)”。

