mirror of
https://github.com/block/buzz.git
synced 2026-11-04 00:12:02 +00:00
The SSE reader split events only on "\n\n", so providers or proxies emitting CRLF or bare-CR line terminators broke event framing. It also let SseReader.buf grow without bound when a stream never produced an event boundary. Streaming requests had no retry on the initial send, and the Responses-API tool-call accumulator used a HashMap, yielding non-deterministic tool-call order. - Normalize CR and CRLF to LF on chunk append (SSE spec equivalence) - Cap SseReader.buf at MAX_LLM_RESPONSE_BYTES, erroring before any unbounded growth - Add send_stream_with_retry() applying the buffered path's transport/ 5xx/429 backoff to the initial request only, stopping before any chunk is emitted to avoid duplicate output - Replace the HashMap tool-call accumulator with a first-seen-ordered Vec to match the buffered parser's ordering Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>