<# BUG分析报告:mimo-v2.5-pro 自定义模型通信故障

<# BUG分析报告:mimo-v2.5-pro 自定义模型通信故障

:one: BUG摘要

项目 内容 BUG名称 Trae CN 自定义模型 mimo-v2.5-pro API 通信 400 错误 错误信息 Param Incorrect (Model Provider Error Code: 400, HTTP Status: 400) 严重等级 :red_circle: 阻塞级 — 模型完全不可用 报告日期 2026-05-19 涉及系统 Trae CN (VS Code 插件) + 小米 MiMo API ( token-plan-cn.xiaomimimo.com )

:two: 环境信息

项目 值 IDE Trae CN (VS Code 衍生版) 数据库 C:\Users\azyp\AppData\Roaming\Trae CN\User\globalStorage\state.vscdb 配置 Key 578777376099883_AI.agent.model.model_list_map 模型 mimo-v2.5-pro (小米 MiMo 团队) API 地址 https://token-plan-cn.xiaomimimo.com/v1/chat/completions 认证方式 Bearer Token (API Key) 涉及 Agent solo_coder / solo_builder / builder / code_reviewer / code_review_summary / refactor / solo_agent (共 7 个)

:three: 重现步骤

3.1 初始配置(Trae UI 添加模型)

在 Trae 设置中添加自定义模型:

3.2 BUG 触发

在任意 Agent(如 solo_coder)中选择 mimo-v2.5-pro 模型,发送对话请求。
→ 返回 Param Incorrect (400)

3.3 多次修复验证

DB 配置经历了 5 轮修改、3 轮测试 ,均为同一错误:

轮次 修改内容 DB 状态 测试结果 1 api_key ← 真实Key, auth_type 0→1 :white_check_mark: :cross_mark: 400 2 base_url 去掉 /chat/completions :white_check_mark: :cross_mark: 400 3 ak ← 真实Key, auth_type 保持0, 删除 api_key :white_check_mark: :cross_mark: 400 4 新增 model = mimo-v2.5-pro :white_check_mark: :cross_mark: 400 5 确认 name/base_url/ak/auth_type/model 全部正确 :white_check_mark: :cross_mark: 400

:four: 根因分析

4.1 最终诊断结果

通过抓包模拟 Trae 的请求行为,定位到 根本原因 :

Trae 发送的请求:
  model = "custom_openai_compatible//mimo-v2.5-pro"   ← 用 
  name 字段
  base_url = "https://token-plan-cn.xiaomimimo.com/v1/chat/
  completions"
  headers = { Authorization: "Bearer <ak>" }

API 返回:
  HTTP 400
  { "error": { "message": "Param Incorrect: Not supported 
  model custom_openai_compatible//mimo-v2.5-pro" } }

4.2 关键证据

测试1: model = "mimo-v2.5-pro"                         → HTTP 
200 ✅
测试2: model = "custom_openai_compatible//mimo-v2.5-pro" → 
HTTP 400 ❌
测试3: model = "mimo-v2.5-pro" (无 max_tokens)          → HTTP 
200 ✅
测试4: 全部参数 (temp/top_p/penalty) 皆齐               → HTTP 
200 ✅

结论: API 只认 model = mimo-v2.5-pro ,而 Trae 发的是 model = custom_openai_compatible//mimo-v2.5-pro 。

4.3 根因定位

100 %

Trae 框架内部逻辑: 发送 API 请求时, model 参数优先使用 name 字段的值,而不是 model 字段。 model 字段虽然存在于 DB 中,但 Trae 的请求构建逻辑没有读取它。

:five: 已尝试修复方案总表

方案 修改内容 结果 失败原因 1 set_mimo_key.py v1 api_key 字段写入Key :cross_mark: 400 Trae 不认 api_key 字段 2 set_mimo_key.py v2 auth_type 0→1 + api_key :cross_mark: 400 Trae 运行时自动回退 auth_type 到0 3 手动 fix_mimo_key.py ak 写入Key + 删 api_key :cross_mark: 400 Key 认证通过,但 model 参数依然错误 4 手动 fix_mimo_key.py v2 新增 model=mimo-v2.5-pro :cross_mark: 400 Trae 忽略 model 字段,继续用 name 5 最终状态确认 6个字段全部正确 :cross_mark: 400 Trae 框架级行为,DB 配置无法覆盖

:six: 结论

:red_circle: 不可修复原因

Trae 内部发送 API 请求时, model 参数固定使用 name 字段的值( custom_openai_compatible//mimo-v2.5-pro ),而小米 MiMo API 不识别该格式的模型名。

这是 Trae 框架级别的写入逻辑问题 ,不是 DB 配置能解决的。所有 DB 字段( model / api_key / auth_type )都会被 Trae 运行时的内部逻辑覆盖或忽略。

:pushpin: 当前 DB 状态(配置正确但无效)

name       = custom_openai_compatible//mimo-v2.5-pro
base_url   = https://token-plan-cn.xiaomimimo.com/v1      ✅
auth_type  = 0                                             ✅
ak         = tp-                                ✅ 
(真实 Key)
model      = mimo-v2.5-pro                                 ✅ 
(但 Trae 不认)
provider   = custom_openai_compatible                      ✅
3 个赞

看到你做了这么详细的分析,辛苦啦!这个问题确实很明确:Trae 在请求时用了 name 字段作为 model 参数,而小米 API 只认 mimo-v2.5-pro

让我先查一下知识库中关于自定义模型配置的相关内容,看看有没有官方的解决方案。看了你的分析,问题定位得非常清楚!确实是 Trae 在发送请求时使用了 name 字段(custom_openai_compatible//mimo-v2.5-pro)作为 model 参数,而小米 API 只识别 mimo-v2.5-pro

这个问题需要在产品层面修复。建议你通过以下方式反馈:

  1. 在 Trae CN 中点击 帮助 → 报告问题 提交这个详细的分析报告
  2. 同时也可以到 TRAE 社区论坛 发帖分享,让其他遇到类似问题的用户也能看到

你这个分析报告写得非常专业,应该能帮助工程师快速定位和修复问题!有新进展随时告诉我。

2 个赞

当前使用的是什么版本的呢?辛苦发一个对话ID

2 个赞

SOLO AgentSOLO Agent

思考过程

The user wants me to verify again. They probably closed Trae CN and want me to check the database now. Let me do that.

_verify_final.py
F:\AI智能审图系统_v6.0_项目开发_verify_final.py

  • 17 - 0

查看变更

Thought

Let me run the verification script.

F:\AI智能审图系统_v6.0_项目开发
白名单运行
在终端查看

$ python “F:\AI智能审图系统_v6.0_项目开发_verify_final.py”

FAIL [solo_coder] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
FAIL [solo_builder] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
FAIL [builder] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
FAIL [code_reviewer] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
FAIL [code_review_summary] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
FAIL [refactor] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
FAIL [solo_agent] https://token-plan-cn.xiaomimimo.com/v1/chat/completions

Result: FAILED

Thought

有进展!URL 从 api.minimax.io/v1 变成了 token-plan-cn.xiaomimimo.com/v1/chat/completions ,说明你重新添加了。但 还是填了完整路径 ,Trae 会自动拼接 /chat/completions ,导致最终请求变成 …/v1/chat/completions/chat/completions 。

现在帮你改成正确的(只到 v1 ):

_fix_db.py
F:\AI智能审图系统_v6.0_项目开发_fix_db.py

  • 41 - 0

查看变更

Thought

Wait, the user might still have Trae CN open since they are chatting with me through it. If Trae CN is running, it will overwrite my changes again. Let me first check if the database is accessible and if Trae is running. But actually, the previous attempt showed that the value changed fromapi.minimax.io/v1 totoken-plan-cn.xiaomimimo.com/v1/chat/completions - this means the user did re-add the model in the UI.

But the problem is: if Trae CN is running, it will overwrite the database. Let me try anyway with IMMEDIATE transaction and see what happens.

Actually, let me just run the script. If Trae is running and overwrites, I’ll tell the user.

F:\AI智能审图系统_v6.0_项目开发
白名单运行
在终端查看

$ python “F:\AI智能审图系统_v6.0_项目开发_fix_db.py”

[solo_coder] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
https://token-plan-cn.xiaomimimo.com/v1
[solo_builder] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
https://token-plan-cn.xiaomimimo.com/v1
[builder] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
https://token-plan-cn.xiaomimimo.com/v1
[code_reviewer] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
https://token-plan-cn.xiaomimimo.com/v1
[code_review_summary] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
https://token-plan-cn.xiaomimimo.com/v1
[refactor] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
https://token-plan-cn.xiaomimimo.com/v1
[solo_agent] https://token-plan-cn.xiaomimimo.com/v1/chat/completions
https://token-plan-cn.xiaomimimo.com/v1

ALL PASS

Thought

The IMMEDIATE transaction worked. All 7 entries are now fixed tohttps://token-plan-cn.xiaomimimo.com/v1 . Let me clean up and tell the user.

But wait - Trae CN is running (since the user is chatting with me through it). It might overwrite again. Let me tell the user that the fix was successful, and they should restart Trae CN for it to take effect.

:white_check_mark: 已强制写入成功!全部修正

Agent 修改前 修改后 solo_coder …v1/chat/completions :cross_mark: …/v1 :white_check_mark: solo_builder 同上 :cross_mark: :white_check_mark: builder 同上 :cross_mark: :white_check_mark: code_reviewer 同上 :cross_mark: :white_check_mark: code_review_summary 同上 :cross_mark: :white_check_mark: refactor 同上 :cross_mark: :white_check_mark: solo_agent 同上 :cross_mark: :white_check_mark:

删除 2 个文件 手动运行

Thought

The fix was written successfully with IMMEDIATE transaction. However, since Trae CN is currently running (the user is chatting with me through it), it may overwrite the database again. I need to tell the user that they need to restart Trae CN for the change to take effect permanently.

重要 :现在 Trae CN 正在运行,它可能会再次覆写。你需要 重启 Trae CN 让修改永久生效。启动后 Trae 会在 https://token-plan-cn.xiaomimimo.com/v1 后面自动拼接 /chat/completions ,最终请求就是正确的完整地址了。
版本:3.3.57
2026-05-09

2 个赞

.578777376099883:d4852152cb967fb9f3abde4f48b65623_6a0b1f5dde2149bf4ddd77b4.6a0bded11dee72149803aee5.6a0bded1616862394b6fccc1:Trae CN.T(2026/5/19 11:53:53)

2 个赞

通了通了通了,就是不能同时部署2个模型应该是小米的问题了

2 个赞

真的吗?什么叫不能连2个模型

2 个赞

送的PLAN API,只能部署一个模型

2 个赞