Skip to content

fix: support multi-megabyte SSE events - #141

Merged
lich0821 merged 1 commit into
lich0821:masterfrom
kokojacket:fix/large-sse-events
Aug 31, 2026
Merged

fix: support multi-megabyte SSE events#141
lich0821 merged 1 commit into
lich0821:masterfrom
kokojacket:fix/large-sse-events

Conversation

@kokojacket

Copy link
Copy Markdown
Contributor

Summary

  • raise the shared SSE scanner limit from 2 MiB to 16 MiB while keeping the 128 KiB initial buffer
  • reuse the configured scanner for streaming, aggregation, completion, usage, text, and rate-limit parsing
  • add a regression test covering a 3 MiB response.completed event

Why

Image-generation responses can contain multi-megabyte SSE data lines. The previous 2 MiB scanner limit aborted otherwise successful upstream streams with bufio.Scanner: token too long.

Tests

  • go test ./... -count=1

@lich0821
lich0821 merged commit 55887d2 into lich0821:master Aug 31, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants