Repository navigation
fix: preserve UTF-8 characters across SSE chunks - #30
Draft
Kayvan-Zahiri wants to merge 1 commit into
Draft
Kayvan-Zahiri wants to merge 1 commit into
Kayvan-Zahiri wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task results containing raw UTF-8 text lose characters when a network byte chunk ends inside a multibyte character.
SSEParser.feeddecodes each chunk separately witherrors="ignore", silently discarding the partial character and its continuation bytes. For example,café 中文 🚀can arrive corrupted even though the SSE event and JSON are valid.Keep one incremental UTF-8 decoder per parser so it retains partial characters between feeds. Preserve the existing error policy for malformed bytes. The parser is already shared by the synchronous and asynchronous stream APIs.
Validation: 34 public sync/async stream cases cover every split within the result and a one-byte-at-a-time stream (18 failed, 16 passed before; all pass after). Full offline suite: 510 passed, 12 live E2E tests deselected, four warnings. Ruff lint/format, mypy on SDK and typing tests/examples, generated sync parity, wheel/sdist builds and diff checks pass. Local Unix-socket tests required execution outside the restricted sandbox. No hosted Render API requests were made. Developed with AI assistance and verified locally.