fix: SSE-aware rehydration for PII split across chunks#3
Open
dfein38347g wants to merge 9 commits into
Open
Conversation
added 8 commits
May 21, 2026 12:52
rehydrate_sse_body() parses the SSE body, joins all delta.content values into one contiguous string, rehydrates there, then reconstructs the SSE with all content in the first chunk. Fixes the case where a fake value (IP, email, API key, etc.) is split across multiple SSE content fields — naive string replacement on the raw buffered body fails because the full value never appears contiguously.
9af6020 to
1a8287c
Compare
Author
SSE-aware rehydrationThe original What changed
Why it mattersAny PII type that gets tokenized across SSE content boundaries benefits — IPs, emails, API keys, SSNs, etc. The tokenizer splits Tests added
|
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.
Summary
--no-streamCLI flag andforce_no_streamconfig option to buffer SSE responses before rehydration, eliminating 128-byte chunk-boundary fragilityhandle_regular_responsepattern)stream: falseinto request body) — breaks client SDK contractforward_requestfast-path is excludedTest Plan
cargo build— clean (1 pre-existing dead_code warning)cargo test— 40 passed, 0 failedcargo clippy— no new warningsFiles changed
Closes issue #4