fix(auto-reply): keep conversation label truncation surrogate-safe#102697
fix(auto-reply): keep conversation label truncation surrogate-safe#102697zw-xysk wants to merge 2 commits into
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: current main still has the conversation-label UTF-16 truncation bug, but the open consolidation PR already carries this same fix with stronger empty-result handling, broader related coverage, sufficient proof, and a mergeable canonical landing path. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Review and land #102823 as the canonical UTF-16 boundary fix, preserving this contributor's useful conversation-label change through that branch. So I’m closing this here and keeping the remaining discussion on #102823. Review detailsBest possible solution: Review and land #102823 as the canonical UTF-16 boundary fix, preserving this contributor's useful conversation-label change through that branch. Do we have a high-confidence way to reproduce the issue? Yes. Current main returns Is this the best way to solve the issue? No for this branch as the landing path. The helper swap is the right primitive, but the canonical consolidation PR includes the same fix plus Security review: Security review cleared: The current PR only uses an existing internal string helper and adds a focused unit test; it does not touch dependencies, workflows, secrets, permissions, or code-execution surfaces. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against f6b990124353. |
Conversation label text generated by LLM is truncated using .slice(0, N) which can split a UTF-16 surrogate pair when the boundary falls inside an emoji, producing invalid Unicode in UI-displayed session labels. Replace .slice(0, maxLength) with truncateUtf16Safe(text, maxLength).
2a4a11f to
84f00be
Compare
|
🦞✅ Reason: structured ClawSweeper close marker: close-required (sha=84f00bebb9b0f7aa5b59ee4c18e267902096be00) Closed:
|
What Problem This Solves
conversation-label-generator.tstruncates LLM-generated conversation labels using.slice(0, N)before returning them for UI display. When the truncation boundary falls inside a UTF-16 surrogate pair (emoji, CJK extended), the resulting label contains a dangling surrogate that renders as U+FFFD (�) in the UI.Changes
src/auto-reply/reply/conversation-label-generator.ts(+2, −1):truncateUtf16Safefrom@openclaw/normalization-core/utf16-slicetext.slice(0, maxLength)→truncateUtf16Safe(text, maxLength)Evidence
Unit tests (7/7 passed):
Real behavior proof (platinum):
Review