fix(cli): keep task/flow/commitment/audit table text truncation UTF-16 safe#101622
fix(cli): keep task/flow/commitment/audit table text truncation UTF-16 safe#101622wm0018 wants to merge 4 commits into
Conversation
…6 safe CLI table rendering for tasks, flows, commitments, and audit commands all share the same truncate(value, maxChars) pattern using raw slice, which can split surrogate pairs at truncation boundaries producing broken U+FFFD in terminal output. Replace slice with truncateUtf16Safe in all four commands.
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close: this PR's current head is tree-identical to the consolidated maintainer-labeled PR at #101654, which explicitly supersedes this branch and carries the broader UTF-16 truncation sweep. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Land or reject the consolidated PR at #101654 as the single owner for this UTF-16 truncation sweep, and close duplicate branches that now have the same tree. So I’m closing this here and keeping the remaining discussion on #101654. Review detailsBest possible solution: Land or reject the consolidated PR at #101654 as the single owner for this UTF-16 truncation sweep, and close duplicate branches that now have the same tree. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current Is this the best way to solve the issue? Yes, using the existing Security review: Security review cleared: The reviewed diff adds no dependency, workflow, permission, secret-handling, or package-resolution changes; it only swaps bounded string slicing for an existing helper and adds tests. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 60f0749b7fb3. |
Exercise truncateUtf16Safe at the exact maxChars boundaries used by the private truncate() helpers in tasks.ts (16/88), flows.ts (10), and commitments.ts (16/28/90). Each test proves a lone high surrogate produced by raw slice is cleanly dropped by truncateUtf16Safe.
8f3e2c9 to
6ec4dc0
Compare
|
Thanks @wm0018. The useful table-truncation work from this PR was consolidated with the sibling UTF-16 boundary fixes into #101654 and landed on The canonical PR uses the existing |
What Problem This Solves
Fixes an issue where CLI table text rendering for
openclaw tasks list,openclaw flows list,openclaw commitments list, andopenclaw audit listcould display broken U+FFFD replacement characters (�) when task names, flow descriptions, commitment scopes, or audit event text contained an emoji or CJK supplementary character at the column width truncation boundary.All four commands share the same
truncate(value, maxChars)pattern using rawString.prototype.slice(0, maxChars - 1), which cuts at UTF-16 code unit boundaries. Emoji like 🚀 are surrogate pairs (2 code units) and get split.Why This Change Was Made
Replace
value.slice(0, maxChars)andvalue.slice(0, maxChars - 1)withtruncateUtf16Safein all four commands — the standard UTF-16-safe truncation helper already used across the codebase.User Impact
CLI
tasks,flows,commitments, andaudittable output containing emoji or CJK near column width limits now display cleanly truncated text.Evidence
Tests
Files Changed (5 files, +44/-6)