fix(ui-skillworkshop): use truncateUtf16Safe for session label truncation#102737
fix(ui-skillworkshop): use truncateUtf16Safe for session label truncation#102737lzyyzznl wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 7:44 AM ET / 11:44 UTC. Summary PR surface: Source +1. Total +1 across 1 file. Reproducibility: yes. Current main uses 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 this shared-helper swap after real behavior proof shows the Skill Workshop revision session label path no longer produces a dangling surrogate, or after a maintainer explicitly overrides that proof gate. Do we have a high-confidence way to reproduce the issue? Yes. Current main uses Is this the best way to solve the issue? Yes for patch shape. The existing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d750477d4352. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1. Total +1 across 1 file. 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
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
What Problem This Solves
One
.slice(0, 80)truncation site in the Skill Workshop UI may cut UTF-16 surrogate pairs in half when the session label contains multi-byte characters such as emoji.Why This Change Was Made
ui/src/pages/skill-workshop/skill-workshop-page.tsuses raw.slice(0, 80)for session label truncation. Replacing withtruncateUtf16Safeensures truncated output is always valid Unicode.User Impact
Truncated session labels in Skill Workshop remain valid Unicode at existing size limits. No behavioral changes for ASCII-only content.
Evidence
Real behavior proof — terminal output
Test scenario: a session label that exceeds the 80-char limit with emoji near the cut boundary.
Scenario A: Cut falls in the middle of surrogate pair
Test string: 'A'x79 + 🦪 + 'X' (len=82)
.slice(0,80) produces dangling high surrogate (0xd83e) -> invalid Unicode
truncateUtf16Safe backs up one code unit -> valid Unicode
Scenario B: emoji entirely beyond cut point
Both .slice and truncateUtf16Safe produce identical valid output
Scenario C: Actual Skill Workshop label near 80-char boundary
Both produce valid output
The critical case is Scenario A: when the 80-char cut falls inside a surrogate pair, .slice(0, 80) produces a dangling high surrogate (0xd83e), which is invalid Unicode. truncateUtf16Safe correctly steps back one code unit to avoid breaking the pair.
Full terminal output and reproduction script are available in the PR worktree.
Generated with Claude Code