Repository navigation
[Bugfix] Fix JSON decode error - #572
Merged
Merged
Conversation
|
🚫 PR 合入质量检查未通过,PR 已被禁止合入。 未通过项:
请按上述提示整改后,重新推送(push)或评论本 PR 即可触发再次检查。 |
Contributor
Author
|
/pr_check |
|
✅ PR 合入质量五项检查全部通过,允许合入。 |
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.
PR Type / PR类型
Related Issue | 关联 Issue
Fixes #482
🔍 Motivation / 变更动机
流式 API 回复可能包含 SSE 元数据行如
id: xxxx以及data:,评价和[DONE]终止符号。当前实现没有处理id:行并试图作为 JSON 处理,导致 JSON 解码错误。The streaming API response may contain SSE metadata lines such as
id: xxxxin addition todata:lines, comment lines, and the[DONE]termination signal. The current implementation does not handleid:lines and attempts to parse them as JSON, which causes a JSON decoding error. This PR fixes the issue by skippingid:metadata lines during streaming response processing.📝 Modification / 修改内容
更新流式回复处理逻辑,识别并跳过
id:避免 JSON 处理。其余回复类型的处理并未更改:data: {...}data lines:comment linesdata: [DONE]termination signal📐 Associated Test Results / 关联测试结果
Please provide links to the related test results, such as CI pipelines, test reports, etc.
请提供相关测试结果的链接,例如 CI 管道、测试报告等。
手动验证了流式 API 回复,使用包含
id:元数据的行进行测试。✅ Checklist / 检查列表
Before PR:
After PR:
👥 Collaboration Info / 协作信息
id:元数据行导致 JSON 解析失败 #482