Files
openclaw/src
ToToKr fe18ceda76 fix(gateway): keep command-list field clamping UTF-16 safe (#102816)
* fix(gateway): keep command-list field clamping UTF-16 safe

clampString truncated command names, descriptions, aliases, arg names/descriptions, and choice values/labels with a raw value.slice(0, maxLength). When an emoji (or other astral code point) straddles the clamp limit, the raw slice keeps a dangling high surrogate and emits a lone surrogate over the gateway commands.list protocol result. Route the clamp through the shared truncateUtf16Safe primitive so the boundary code point is dropped whole. Adds a regression test through buildCommandsListResult.

* test(gateway): fold UTF-16 clamp regression into bounds coverage

Co-authored-by: MoerAI <friendnt@g.skku.edu>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-09 15:25:59 +01:00
..