Commit e4e2979
refactor: route the remaining code-unit clips through truncateUtf16Safe
The MCP header-warning ellipsis in sep-2243 and the Telegram draft/chunk prefix were two more hand-written copies of the same boundary rule on a UTF-16 code-unit budget. Both now call the shared helper, which retires the Telegram-local prefix walk and its direct test; the same cases live in text-sanitize.test.ts. thread-search's capCodePoints stays as is: its budget is code points, not code units, so it is a different contract rather than another copy.
Generated-by: Claude Code (Fable 5.1)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FTqr6ZjXfNthXT719ag7Qc1 parent e04bdeb commit e4e2979
3 files changed
Lines changed: 7 additions & 39 deletions
File tree
- packages
- mcp/src
- runtime/src/bots
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
281 | 282 | | |
282 | 283 | | |
283 | 284 | | |
284 | | - | |
285 | | - | |
286 | | - | |
| 285 | + | |
| 286 | + | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| |||
Lines changed: 1 addition & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 28 | | |
39 | 29 | | |
40 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 67 | | |
89 | 68 | | |
90 | 69 | | |
| |||
100 | 79 | | |
101 | 80 | | |
102 | 81 | | |
103 | | - | |
| 82 | + | |
104 | 83 | | |
105 | 84 | | |
106 | 85 | | |
| |||
264 | 243 | | |
265 | 244 | | |
266 | 245 | | |
267 | | - | |
268 | 246 | | |
269 | 247 | | |
270 | 248 | | |
| |||
374 | 352 | | |
375 | 353 | | |
376 | 354 | | |
377 | | - | |
| 355 | + | |
378 | 356 | | |
379 | 357 | | |
380 | 358 | | |
| |||
0 commit comments