Commit eb05889
committed
fix(agents): keep tool/command display truncation UTF-16 safe
Replace raw .slice(0, N) with truncateUtf16Safe from
@openclaw/normalization-core/utf16-slice across 4 agent modules:
- tool-search: compactDirectoryDescription @177-code-unit boundary
- gateway-tool: restart reason @200-code-unit boundary
- openai-transport-stream: redacted payload/event @8000/2000
- command/attempt-execution: ACP diagnostic text @240
All sites truncate user-visible or agent-generated text where
emoji/CJK supplementary characters can be split mid-surrogate.1 parent 3901094 commit eb05889
4 files changed
Lines changed: 193 additions & 44 deletions
File tree
- src/agents
- command
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
1023 | 1024 | | |
1024 | 1025 | | |
1025 | 1026 | | |
1026 | | - | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
1027 | 1032 | | |
1028 | 1033 | | |
1029 | 1034 | | |
| |||
1162 | 1167 | | |
1163 | 1168 | | |
1164 | 1169 | | |
1165 | | - | |
| 1170 | + | |
1166 | 1171 | | |
1167 | 1172 | | |
1168 | 1173 | | |
| |||
1303 | 1308 | | |
1304 | 1309 | | |
1305 | 1310 | | |
1306 | | - | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
1307 | 1316 | | |
1308 | 1317 | | |
1309 | 1318 | | |
| |||
0 commit comments