fix(acp): use truncateUtf16Safe for event mapper error text truncation#101535
Conversation
.slice(0, 100) on ACP event argument values can split surrogate pairs from emoji or CJK text, producing U+FFFD in error/warning notices shown to operators. Co-Authored-By: Claude <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 7, 2026, 6:44 AM ET / 10:44 UTC. Summary PR surface: Source +1, Tests +10. Total +11 across 2 files. Reproducibility: yes. Current main and Review metrics: none identified. 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
Security Review detailsBest possible solution: Land the narrow helper swap with the focused regression test after the PR body includes redacted real ACP output showing boundary-case tool titles no longer contain replacement characters. Do we have a high-confidence way to reproduce the issue? Yes. Current main and Is this the best way to solve the issue? Yes. Reusing the existing surrogate-safe helper at the exact title truncation point is the narrowest maintainable fix; the remaining gap is real ACP behavior proof, not code shape. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 942b44966107. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1, Tests +10. Total +11 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 at exact head Maintainer review improved the dependency boundary by replacing the broad normalization package import with the leaf Validation:
No known proof gaps. |
|
Merged via squash.
|
openclaw#101535) * fix(acp): use truncateUtf16Safe for event mapper error text truncation .slice(0, 100) on ACP event argument values can split surrogate pairs from emoji or CJK text, producing U+FFFD in error/warning notices shown to operators. Co-Authored-By: Claude <[email protected]> * test(acp): cover UTF-16-safe tool titles * refactor(acp): keep event mapper import leaf-only --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
openclaw#101535) * fix(acp): use truncateUtf16Safe for event mapper error text truncation .slice(0, 100) on ACP event argument values can split surrogate pairs from emoji or CJK text, producing U+FFFD in error/warning notices shown to operators. Co-Authored-By: Claude <[email protected]> * test(acp): cover UTF-16-safe tool titles * refactor(acp): keep event mapper import leaf-only --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
ACP event mapper truncates error argument values with
.slice(0, 100). Tool call arguments and error text may contain CJK characters or emoji — a slice boundary in the middle of a surrogate pair produces U+FFFD in operator-visible warning messages.Why This Change Was Made
Replace
.slice(0, 100)withtruncateUtf16Safe().Evidence
Part of the UTF-16 safety sweep.
Issue
N/A
🤖 Generated with Claude Code