Commit 9e79720
committed
fix(shared): use truncateUtf16Safe in assistant-identity-values
Replace raw .slice(0, maxLength) with truncateUtf16Safe to prevent
emoji surrogate pair truncation issues in assistant identity values.
The coerceIdentityValue function is used to truncate assistant name,
avatar, and emoji values. When these values contain emoji at the
truncation boundary, the old implementation could produce lone
surrogates (invalid UTF-16 text).
This fix follows the same pattern as PR #102477 which addressed
similar issues in talk/fast-context-runtime.ts and
infra/heartbeat-events-filter.ts.1 parent 8870138 commit 9e79720
2 files changed
Lines changed: 24 additions & 3 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
24 | 44 | | |
25 | 45 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
0 commit comments