zai-org / zai-org/feedback

[Bug] [v3.7.6] macOS:主智能体用 qwen3.7-max(阿里云百炼 OpenAI 兼容)时思考过程不显示 —— 推理内容被 "Non-OpenAI reasoning parts are not supported" 过滤丢弃

Open
#293 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist
  • 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.

(查重备注:与 #202(第三方模型无法选择思考等级)、#233(OpenAI 官方模型参数不兼容)、#222/#231(Anthropic/GLM thinking 参数冲突)均不同——本问题是 OpenAI 兼容 provider 的推理内容在客户端被过滤丢弃。)

问题类别 · Category

对话 / Agent 交互 · Agent chat

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

影响体验 · Major (功能可用但体验受损 / works but degraded)

复现频率 · Reproducibility

必现 · Always

问题描述 · Description

环境

  • OS: macOS 26.5.1 (25F80), Apple M5, arm64
  • ZCode: 3.7.6 (3.7.6.4691)
  • 主智能体模型:自定义 OpenAI 兼容 provider → 阿里云百炼 https://…maas.aliyuncs.com/compatible-mode/v1,模型 qwen3.7-max(kind = openai / responses)
  • 对照:deepseek-v4-pro / deepseek-v4-flash(思考过程正常显示);子代理(deepseek)思考过程也正常
  • 数据目录:~/.zcode/cli/db/db.sqlite 的 part 表 + cli/log/zcode-*.jsonl

现象

  1. 已开启「思考过程展示」(~/.zcode/v2/setting.json"messageStreamShowReasoning": true),思考级别为 max,但主智能体思考过程完全空白;
  2. 同一会话中子代理的思考过程正常显示;
  3. 重启、重开开关均无效。

根因定位(客户端侧,已取证)

  1. 数据库:qwen3.7-max 的 reasoning part 全部落为空壳:
    {"type":"reasoning","text":"","metadata":{"openai":{"itemId":"msg_…","reasoningEncryptedContent":null}},…}
    同一会话切到 qwen3.7-max 之前(deepseek)的 35 个 part 全有文字,切换后 82 个全部为空;百炼 usage 的 reasoningTokens 仍正常计费——模型确实推理了,内容没落库。
  2. 日志cli/log/zcode-2026-08-13.jsonl(149 条)+ 2026-08-14.jsonl(29 条),全部 "model":"qwen3.7-max""provider":"openai.responses"
    "Non-OpenAI reasoning parts are not supported. Skipping reasoning part: {"type":"reasoning","text":"Let me understand what's happening here. …"}
    注意被跳过的 part 携带完整思考文本——内容已到达客户端,在管线里被主动丢弃。
  3. 代码:运行时代码 Resources/glm/zcode.cjs 中 reasoning 分支只保留两类:
    携带 OpenAI 风格 itemId 的增量;或携带 reasoningEncryptedContent 的增量。两者皆无 → 丢弃并打上述 warning。
    而百炼 /responses 的流式 reasoning 增量不携带 providerOptions.openai.itemId(最终 response.output 里的 reasoning item 才带 msg_ 前缀 id),于是流式文本全部被丢,最终只落一个空壳 part,UI 无内容可显示。

时间线(东八区):

时间 事件
08-13 12:58 前 主智能体为 deepseek-v4-pro,思考过程正常
08-13 13:05 切换到 qwen3.7-max 后,首次出现该 warning
08-13 13:25 起 该会话所有 reasoning part 均为空,至今必现
复现步骤 · Steps to reproduce
  1. 添加自定义 provider:kind 选 OpenAI,baseURL 填阿里云百炼兼容接口 https://…maas.aliyuncs.com/compatible-mode/v1,添加模型 qwen3.7-max
  2. 在任一项目会话把主智能体模型切换为 qwen3.7-max,并开启「思考过程展示」;
  3. 发送任意任务,等待模型输出;
  4. 观察:主智能体消息无思考过程;~/.zcode/cli/log/zcode-<日期>.jsonl 中每条响应伴随约 35 条 model.sdk.warning("Non-OpenAI reasoning parts are not supported. Skipping reasoning part: …");
  5. 对照:同会话换回 deepseek 系模型,思考过程立即恢复。
期望表现 · Expected behavior

开启思考过程展示后,主智能体(包括 OpenAI 兼容接口的第三方可推理模型)的思考过程应正常显示。

实际表现 · Actual behavior

qwen3.7-max 的推理内容在流式阶段被管线过滤丢弃,UI 无思考过程;内容本身已到达客户端(见 warning 中的文本),且推理 token 正常计费。

截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
// ~/.zcode/cli/log/zcode-2026-08-14.jsonl 节选(共 29 条,全部 qwen3.7-max)
{"timestamp":"2026-08-14T07:12:57.294Z","level":"warn","event":"model.sdk.warning","module":"bootstrap.zcode_protocol","message":"AI SDK model warning","context":{"entrypoint":"zcode_protocol","model":"qwen3.7-max","provider":"openai.responses","warningCount":35,"warnings":[{"type":"other","message":"Non-OpenAI reasoning parts are not supported. Skipping reasoning part: {\"type\":\"reasoning\",\"text\":\"Let me understand what's happening here. …(完整思考文本,截断)"}]}}
// ~/.zcode/cli/db/db.sqlite part 表,qwen3.7-max 会话的 reasoning part(text 恒为空)
{"type":"reasoning","text":"","metadata":{"openai":{"itemId":"msg_49b8087d-87b5-4953-94b4-feb31b46498d","reasoningEncryptedContent":null}},"time":{"start":1786692975421,"end":1786693010057}}

建议修复方向(供参考)

  1. 对不带 itemId 的 reasoning 增量不应整体丢弃,其文本应保留(合并进对应最终 item 或直接落库);
  2. 或将 OpenAI 兼容 provider 的 reasoning item 做归一化(itemId 取最终 response.outputmsg_ 前缀 id),使流式文本有归属可挂。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reasoning branch in Resources/glm/zcode.cjs and the model.sdk.warning entries in cli/log/zcode-*.jsonl. Reproduce with the qwen3.7-max OpenAI-compatible provider, then inspect the resulting cli/db/db.sqlite part records. Done means streamed reasoning text is retained and displayed instead of becoming empty reasoning parts while existing DeepSeek behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos
Domain
ai, api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.