是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?
该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?
当前行为 | Current Behavior
问题:思考模式下携带 response_format 时,最终回复会偏离模型自己的思考定稿。
在百炼 OpenAI 兼容接口上调用 qwen3.8-max / qwen3.8-flash 等思考模型时:
- 请求携带
response_format={"type": "json_object"}:返回的 content 是合法 JSON,但其结论与同一次调用的 reasoning_content 结尾处模型已经写定的结论不一致,并且会出现整段 reasoning_content 中从未出>现过的数值。
- 请求不携带
response_format:content 与 reasoning_content 的定稿逐字一致。
两者唯一的差别就是 response_format 这一个参数,messages、seed、模型、其余参数完全相同。
期望行为 | Expected Behavior
使用思考模式+response_format={"type": "json_object"}时,最终的返回结果跟思考模式的结论一致。
复现方法 | Steps To Reproduce
用同一组 messages、同一 seed 连发两次请求
唯一变量是是否携带response_format={"type": "json_object"}。对比content和reasoning_content的结论是否一致。
运行环境 | Environment
| 项 | 值 |
| --- | --- |
| 接入方式 | OpenAI 兼容接口 |
| base_url | https://dashscope.aliyuncs.com/compatible-mode/v1 |
| 模型 | qwen3.8-max、qwen3.8-flash、qwen3.8-27b、第三方的glm-5.2和kimi-k3 均可复现 |
| SDK | openai-python 2.8.1 |
| Python | 3.12.13 |
| 关键参数 | `extra_body={"enable_thinking": True}`、`stream=True`、`seed` 固定;未设置 `max_tokens`、未设置 `temperature` |
备注 | Anything else?
我们已经排除的因素
- 字段读取:
choices[0].message.content / .reasoning_content,与官方非流式示例一致;返回体中不存在第三个正文字段。
- 流式与非流式:两种方式表现一致,不是解析流式增量导致的。
- max_tokens:全程未设置(已知文档要求结构化输出时不要设置)。
- temperature:我们默认不设置;额外测试
temperature=0.05,偏差不但没有消失,反而更大。
- 请求体:仅
model / messages / response_format / extra_body.enable_thinking 四个键,无其它参数干扰。
- json_object 与 json_schema:两种结构化模式都会出现,不是某一种模式特有。
- 模型范围:qwen3.8-max、qwen3.8-flash、qwen3.8-27b、glm-5.2、kimi-k3 均可复现;但是我用GLM的官方API测试则没有出现这个问题,content和reasoning_content是一致的。
是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?
该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?
当前行为 | Current Behavior
问题:思考模式下携带 response_format 时,最终回复会偏离模型自己的思考定稿。
在百炼 OpenAI 兼容接口上调用 qwen3.8-max / qwen3.8-flash 等思考模型时:
response_format={"type": "json_object"}:返回的content是合法 JSON,但其结论与同一次调用的reasoning_content结尾处模型已经写定的结论不一致,并且会出现整段reasoning_content中从未出>现过的数值。response_format:content与reasoning_content的定稿逐字一致。两者唯一的差别就是
response_format这一个参数,messages、seed、模型、其余参数完全相同。期望行为 | Expected Behavior
使用思考模式+response_format={"type": "json_object"}时,最终的返回结果跟思考模式的结论一致。
复现方法 | Steps To Reproduce
用同一组 messages、同一 seed 连发两次请求
唯一变量是是否携带
response_format={"type": "json_object"}。对比content和reasoning_content的结论是否一致。运行环境 | Environment
备注 | Anything else?
我们已经排除的因素
choices[0].message.content/.reasoning_content,与官方非流式示例一致;返回体中不存在第三个正文字段。temperature=0.05,偏差不但没有消失,反而更大。model/messages/response_format/extra_body.enable_thinking四个键,无其它参数干扰。