fix(crestodian): use truncateUtf16Safe for conversation text truncation#102770
fix(crestodian): use truncateUtf16Safe for conversation text truncation#102770lzyyzznl wants to merge 1 commit into
Conversation
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(crestodian): use truncateUtf16Safe for conversation 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 this tiny cross-owner bundle in favor of the wider UTF-16 cleanup. It changes three unrelated production sites without focused tests, overlaps prior embedding work, and the stream-normalizer half only fixes prefix slicing while leaving its suffix edge independently unsafe. The valid sites should be consolidated by owner with active-path regression coverage, including both stream boundaries. |
What Problem This Solves
One
.slice(0, N)truncation site in Crestodian assistant prompts may cut UTF-16 surrogate pairs in half when the conversation text contains multi-byte characters such as emoji.Why This Change Was Made
src/crestodian/assistant-prompts.tsuses raw.slice(0, HISTORY_TURN_MAX_CHARS)for conversation history truncation. Replacing withtruncateUtf16Safeensures the displayed text is always valid Unicode.User Impact
Truncated conversation history in Crestodian remains valid Unicode at existing size limits. No behavioral changes for ASCII-only content.
Generated with Claude Code