[Bug] M2-her chat completions API: messages 含高级角色 (user_system / group / sample_message_*) 时 100% 返回 HTTP 500 999-1000
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Start by comparing the documented chat completions roles with the behavior described for the M2-her endpoint at https://api.minimaxi.com/v1. The issue provides minimal curl requests and request IDs, but names no repository files, tests, or server entry point; first check whether this repository contains the endpoint implementation or only model assets. Done means requests containing each documented advanced role return successful responses, with a clear validation error if a role is unsupported.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
概述
M2-her 服务端在 messages 数组中包含任何「高级角色」时,100% 触发 HTTP 500 错误 unknown error, 999 (1000)。
官方文档(platform.minimaxi.com/docs/guides/text-chat)明确支持以下角色:
role: "user_system"role: "group"role: "sample_message_user"/"sample_message_ai"
但服务端实际处理这些 role 时稳定报错。只有 system / user / assistant 三个基础角色能正常返回 200。
环境信息
- 端点:
https://api.minimaxi.com/v1 - 模型:
M2-her - 请求方式:OpenAI Python SDK / 直接 HTTPS 两种都复现
- 发现时间:2026-06-01
- request_id 示例:
066d760ecbf38a76d782267fa10257c7、066d68c23b703caa12cc5abfcbc1b801
复现步骤
正常情况:只用 3 个基础角色
curl https://api.minimaxi.com/v1/chat/completions \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "M2-her",
"messages": [
{"role": "system", "content": "你是小咪。必须用中文。"},
{"role": "user", "content": "你好"}
],
"max_completion_tokens": 80,
"temperature": 0.7,
"stream": true,
"thinking": {"type": "disabled"}
}'
→ HTTP 200,正常返回 SSE 流。
异常情况:加入 user_system
curl https://api.minimaxi.com/v1/chat/completions \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "M2-her",
"messages": [
{"role": "system", "content": "你是小咪。"},
{"role": "user_system", "content": "我是冷淡的科学家"},
{"role": "user", "content": "你好"}
],
"max_completion_tokens": 80,
"temperature": 0.5,
"stream": true,
"thinking": {"type": "disabled"}
}'
→ HTTP 500,body 内容:
{"type":"error","error":{"type":"server_error","message":"unknown error, 999 (1000)","http_code":"500"},"request_id":"066d..."}
同样的错误会出现在 group / sample_message_user / sample_message_ai
只要 messages 里任意包含一个这些角色,就触发同一个 500。去掉就立刻 200。
测试组合(每个组合 n=3)
| messages 包含 | 结果 |
|---|---|
system, user |
✅ 200 |
system, user, assistant |
✅ 200 |
system, user_system, user |
❌ 500 |
system, group, user |
❌ 500 |
system, user_system, group, user |
❌ 500 |
system, sample_message_user, sample_message_ai, user |
❌ 500 |
可复现性:每个组合都跑 3 次,没有任何偶发失败模式——失败完全由请求结构决定。
期望行为
按 官方文档,高级角色应该正常工作:
user_system:用于定义用户人设group:用于场景上下文sample_message_user/sample_message_ai:用于 few-shot 示例
实际行为
返回 HTTP 500,错误信息 unknown error, 999 (1000),没有任何可操作的细节,也没有 role 校验失败的明确报错。
影响范围
这导致按官方文档实现的 M2-her 角色扮演场景完全无法使用。任何遵循官方文档的代码(system + user_system + group + few-shot 样本)都会 100% 失败。
临时绕过方案
我们不得不降级到 OpenAI 兼容格式(只用 system / user / assistant),把 user_system / group / sample_message_* 内容拼成文本塞到 system prompt 里。能跑通,但失去高级角色的结构性优势(模型也可能因此无法很好地区分这些角色)。
已排除的可能原因
- ❌ 不是 key 问题:基础角色用同一 key 正常 200
- ❌ 不是网络问题:基础角色 200 说明网络通畅
- ❌ 不是 prompt 内容问题:最小复现(只 2-3 条消息)也失败
- ❌ 不是配额问题:账户余额充足,月内消耗正常
- ❌ 不是偶发问题:每个组合 3 次都稳定复现
关联
- 一个按官方文档实现并被这个 bug 卡住的开源工具:klarkxy/minichat — README 详细记录了实测和临时绕过方案
- 官方文档:platform.minimaxi.com/docs/guides/text-chat
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 2.6k
- Fork
- 216
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MiniMax-AI/MiniMax-M2
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 1/100
MiniMax-AI/MiniMax-M2#133 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 1/100
MiniMax-AI/MiniMax-M2#132 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 1/100
MiniMax-AI/MiniMax-M2#130 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 1/100
MiniMax-AI/MiniMax-M2#129 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 43/100
MiniMax-AI/MiniMax-M2#123 · 3 bình luận ·
Tất cả issue của MiniMax-AI/MiniMax-M2
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
dsavransky/EXOSIMS#497 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
dginev/latexml-oxide#1132 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BoolType values: only the first byte of the 32-bit value is tested (e.g. 00 00 01 00 → False)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
EricZimmerman/evtx#281 ·
-
bugfix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 3 ngày
-
ClickHouse: quantile is read as the exact Quantile, though ClickHouse's quantile is approximateĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày