** 流式传输: 在 `[DONE]` SSE 事件之后连接强制关闭 (TCP FIN), 因为分块终止符未被清除 – 来自 `6132922c` 的回退 **
作者: CH3CHO创建于 2026年6月25日更新于 2026年9月10日
标签bug
`Stream` should fully drain the underlying `iter_bytes()` / `aiter_bytes()` after observing `[DONE]` — including consuming the HTTP/1.1 chunked terminator `0\r\n\r\n` — so that h11's `their_state` advances to `DONE` *before* `response.close()` is called. With `their_state == h11.DONE`, httpcore/h11 takes the graceful close path (back to `IDLE`, connection returns to the pool) rather than the destructive one.
内容来源: openai/openai-python