openclaw/scripts/repro
pick-cat 74e2c2afdd
fix(scripts): preserve surrogate pairs when truncating LLM text in bench dump (#110546)
* fix(scripts): use truncateUtf16Safe for LLM text truncation in bench dump

Three .slice(0, N) calls truncate assistant/tool result/final text for
logging output. Raw String.prototype.slice operates on UTF-16 code
units and can split surrogate pairs (emoji, CJK characters) straddling
the cut boundary, producing invalid Unicode in trail and result output.

Replace with truncateUtf16Safe from @openclaw/normalization-core/utf16-slice,
the same helper already used across the codebase for safe boundary truncation.

Co-Authored-By: nebulacoder-v8.0 <noreply@zte.com.cn>

* test(scripts): add behavioral proof for UTF-16 safe truncation in bench dump

Co-Authored-By: Pick-cat <huang.ting3@xydigit.com>

* test(scripts): replace root proof harness with repository-native bench dump truncation tests

Remove the 163-line root-level proof artifact and add focused vitest
tests in test/scripts/ that exercise the exact truncateUtf16Safe call
sites and format strings used by the bench script — without needing a
live LLM benchmark run.

Co-Authored-By: Pick-cat <huang.ting3@xydigit.com>

* test(scripts): remove redundant UTF-16 helper coverage

---------

Co-authored-by: nebulacoder-v8.0 <noreply@zte.com.cn>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-20 19:25:02 -07:00
..
code-mode-namespace-live-docker.sh
code-mode-namespace-live-scenario.sh
code-mode-namespace-live.ts refactor(deadcode): enforce full-repository hard zero (#108717) 2026-07-16 00:16:20 -07:00
limit-edge-case-live-proof.d.mts chore(tooling): typecheck root test/** with a dedicated tsgo lane (#104475) 2026-07-11 06:15:41 -07:00
limit-edge-case-live-proof.mjs refactor(logging): trim internal export surface (#107407) 2026-07-14 04:12:23 -07:00
tool-schema-hint-bench.ts perf(agents): wave-1 tool output contracts for code mode (#110215) 2026-07-18 01:02:18 +01:00
tool-surface-live-bench.ts fix(scripts): preserve surrogate pairs when truncating LLM text in bench dump (#110546) 2026-07-20 19:25:02 -07:00
tsx-name-repro.ts docs: document repository scripts 2026-06-04 20:52:50 -04:00