Commit 4fa3118
fix(native-hook-relay): use truncateUtf16Safe for hook display text truncation (#102467)
* fix(tool-policy-audit): use truncateUtf16Safe for audit field truncation
Replace naive .slice(0, MAX) with truncateUtf16Safe() to prevent
surrogate pair splitting in tool policy audit log output.
Co-Authored-By: Claude <[email protected]>
* fix(native-hook-relay): use truncateUtf16Safe for hook display text truncation
Replace naive .slice(0, N) truncation with truncateUtf16Safe() in:
- truncateText() helper (covers 4 call sites for tool display text)
- Inline hook result truncation (...[truncated] suffix)
Prevents surrogate pair splitting in native hook relay display
output (tool names, commands, descriptions shown to users).
Co-Authored-By: Claude <[email protected]>
* test(agents): cover hook relay UTF-16 boundaries
---------
Co-authored-by: Claude <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>1 parent 472e516 commit 4fa3118
2 files changed
Lines changed: 47 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1370 | 1370 | | |
1371 | 1371 | | |
1372 | 1372 | | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
1373 | 1399 | | |
1374 | 1400 | | |
1375 | 1401 | | |
| |||
3407 | 3433 | | |
3408 | 3434 | | |
3409 | 3435 | | |
| 3436 | + | |
| 3437 | + | |
| 3438 | + | |
| 3439 | + | |
| 3440 | + | |
| 3441 | + | |
| 3442 | + | |
| 3443 | + | |
| 3444 | + | |
| 3445 | + | |
| 3446 | + | |
| 3447 | + | |
| 3448 | + | |
| 3449 | + | |
3410 | 3450 | | |
3411 | 3451 | | |
3412 | 3452 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
1925 | 1926 | | |
1926 | 1927 | | |
1927 | 1928 | | |
1928 | | - | |
1929 | 1929 | | |
| 1930 | + | |
1930 | 1931 | | |
1931 | 1932 | | |
1932 | | - | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
1933 | 1937 | | |
1934 | 1938 | | |
1935 | 1939 | | |
| |||
2223 | 2227 | | |
2224 | 2228 | | |
2225 | 2229 | | |
2226 | | - | |
| 2230 | + | |
2227 | 2231 | | |
2228 | 2232 | | |
2229 | 2233 | | |
| |||
0 commit comments