fix(gateway): use truncateUtf16Safe for config path display truncation#102513
Conversation
Replace naive .slice(0, 117) with truncateUtf16Safe() to prevent surrogate pair splitting in config path sanitization output. Co-Authored-By: Claude <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 4:16 AM ET / 08:16 UTC. Summary PR surface: Source +1, Tests +13. Total +14 across 2 files. Reproducibility: yes. source-reproducible: current main raw-slices sanitized config paths at 117 UTF-16 code units before adding an ellipsis, so an emoji crossing that boundary can leave a dangling surrogate. I did not run a live Gateway/OpenClaw scenario in this read-only review. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Keep the centralized sanitizer and land the helper substitution only after redacted real Gateway log/output proof or an explicit maintainer proof override. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main raw-slices sanitized config paths at 117 UTF-16 code units before adding an ellipsis, so an emoji crossing that boundary can leave a dangling surrogate. I did not run a live Gateway/OpenClaw scenario in this read-only review. Is this the best way to solve the issue? Yes for the implementation shape: reusing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 769878303744. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1, Tests +13. Total +14 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
|
Land-ready maintainer verification at exact head
No config shape, default, gateway protocol, or docs surface changed. |
|
Merged via squash.
|
openclaw#102513) * fix(gateway): use truncateUtf16Safe for config path display truncation Replace naive .slice(0, 117) with truncateUtf16Safe() to prevent surrogate pair splitting in config path sanitization output. Co-Authored-By: Claude <[email protected]> * test(gateway): prove config path UTF-16 boundary --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
The config path sanitizer uses naive .slice(0, 117) which can split surrogate pairs when sanitized paths contain emoji or other multi-codepoint characters.
Why This Change Was Made
Replace with truncateUtf16Safe(). Same pattern as #102464, #102467, #102500 (all merged).
Files Changed
🤖 Generated with Claude Code