zai-org / zai-org/feedback

[Bug] 某些自定义 provider 的 /chat/completions 接口返回的流式 delta.content 不会触发客户端聚合缓冲

Open
#706 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2 status: 待评估 type: Bug
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.
问题类别 · Category

其他 / 不确定 · Other / Not sure

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

阻塞使用 · Blocking (无法使用核心功能 / core function unusable)

复现频率 · Reproducibility

必现 · Always

问题描述 · Description

有的自定义 provider 的 /chat/completions 接口返回的流式 delta.content 似乎没有客户端聚合缓冲,见截图。

该接口的流式 chunks 会传 "finish_reason":"" 而不是 "finish_reason":null

Image
复现步骤 · Steps to reproduce
  1. 添加自定义 provider (API 格式为 /chat/completions)
  2. 发送问题
期望表现 · Expected behavior

客户端自己聚合流式流式 content 片段

实际表现 · Actual behavior

客户端未做聚合,每个 chunk 的 content (一两个token)都会显示一条"思考",导致刷屏卡死

ZCode 版本 · ZCode version

v3.12.3

设备 / 系统 / 浏览器 · Device / OS / Browser

Windows

截图 / 录屏 / 日志 · Screenshots / Recordings / Logs
Image

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

Reproduce the issue with a custom /chat/completions provider whose streaming chunks use "finish_reason":"". Inspect the client’s streaming aggregation path; done means content fragments are buffered into one displayed response instead of creating separate thinking entries for each chunk.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.