Skip to content

fix: support multi-megabyte SSE events - #141

Open
kokojacket wants to merge 1 commit into
lich0821:masterfrom
kokojacket:fix/large-sse-events
Open

fix: support multi-megabyte SSE events#141
kokojacket wants to merge 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

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.

1 participant