fix(provider):模型流式输出中途截断但界面无错误提示#191
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
变更说明
本次变更修复了一个主链路可观测性问题:
Ready,但回答内容实际上只输出了一半;本次 PR 聚焦于“流式结束判定错误”这一主因,不包含对历史坏 session 文件的自动修复。
主要改动
1. provider 层严格校验
[DONE]internal/provider/openai/response.goEOF结束但未收到[DONE]时,返回provider.ErrStreamInterruptedmessage_done2. runtime 层要求必须收到
message_doneinternal/runtime/runtime.gomessage_doneprovider.Chat()返回nil但没有message_done时,runtime 直接按中断错误处理EventAgentDone3. 补充回归测试
internal/provider/openai/openai_test.goEOF且缺失[DONE]时应返回中断错误internal/runtime/runtime_test.gomessage_done时 runtime 应报错而非完成预期收益