fix: treat SSE stream without [DONE] as truncated (retry, no cache)
This commit is contained in:
@@ -578,6 +578,10 @@ class GovernedLLMClient:
|
||||
else:
|
||||
thinking_parts.append(text)
|
||||
|
||||
# 流耗尽但未收 [DONE] → 服务端截断,视为可重试的 SSE 异常(不写缓存/不当成功)
|
||||
if not usage_sink.get("done"):
|
||||
raise _SseAnomaly("truncated_no_done")
|
||||
|
||||
content = "".join(content_parts)
|
||||
thinking = "".join(thinking_parts)
|
||||
usage = usage_sink.get("usage", {})
|
||||
|
||||
Reference in New Issue
Block a user