fix(stream-normalizer): use truncateUtf16Safe for text truncation#102775
fix(stream-normalizer): use truncateUtf16Safe for text truncation#102775coder-master-0915 wants to merge 2 commits into
Conversation
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(stream-normalizer): use truncateUtf16Safe for text truncation This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Closing as a later subset of #102770. This duplicates the untested Crestodian/stream-normalizer substitutions, and the stream change remains one-sided because the suffix slice can still split a surrogate pair. #102770 is also closed so the valid sites can be consolidated into the wider UTF-16 cleanup with both-edge active-path coverage. |
What Problem This Solves
One
.slice(0, N)truncation site may cut UTF-16 surrogate pairs in half when the text contains multi-byte characters such as emoji.Why This Change Was Made
Replacing
.slice(0, N)withtruncateUtf16Safeensures truncated output is always valid Unicode.User Impact
Truncated text remains valid Unicode at existing size limits. No behavioral changes for ASCII-only content.
Generated with Claude Code