fix(providers): 中继 reasoning summary 正文漏进回答 — 按步骤终态分流#146
Merged
Conversation
Responses→chat.completions shims (observed: gpt-5.x behind OpenAI-compatible relays) split each reasoning-summary part across two fields: the bold headline arrives as a single delta.reasoning_content chunk (**…**) while the part's BODY streams as plain delta.content. The planning prose then rendered as the assistant's reply, concatenated across steps without separators. Provider stream loop now runs a small state machine: after a headline-only reasoning chunk, content deltas buffer; a tool-call delta or finish=tool_calls proves the buffer was planning prose → flushed into the reasoning block; finish=stop or outgrowing the 4KB summary cap proves it was the real answer → flushed back as ordinary content. DeepSeek-R1-style multi-chunk reasoning prose never matches the headline gate, so real answers keep streaming live. Summary parts join with blank lines; the chat reducer also inserts a paragraph break when a new headline lands flush against the previous step's reasoning. Verified against the live relay wire shape (headline via reasoning_content → body via content → tool_calls) and covered by six new offline stream tests.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…out finish_reason
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复 #145 之后用户报告的聊天问题:gpt-5.6-sol(Responses→chat.completions 中继)把 reasoning summary 的标题发到
delta.reasoning_content(单 chunk**…**),而 summary 正文当普通delta.content流下来 → 规划文字被渲染成助手正文,且跨步骤无分隔拼接。修法(provider 流式状态机):
**…**整块)之后的 content 进入缓冲验证:直连中继复现原始 SSE 形态(标题→正文→tool_calls)后按形态建模;新增 6 个离线流测试;providers 538 测试 + agent reasoning 101 测试 + ui 1153 测试全绿;既有 R1 测试抓住并修正了一个分隔符实现瑕疵。