fix: keep emoji intact at remaining text truncation boundaries#101754
Conversation
Replace .slice(0, N) with truncateUtf16Safe() in five remaining user-visible text truncation sites that were missed by earlier UTF-16 safety sweeps: - restart.ts: restart reason text (2 sites) - chat-composer.ts: reply target text preview - chat-thread.ts: thread text preview + message text extraction All sites truncate user-generated content where emoji or other supplementary-plane characters could produce lone surrogates. Co-Authored-By: Claude <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 7, 2026, 12:26 PM ET / 16:26 UTC. Summary PR surface: Source +4, Tests +62. Total +66 across 8 files. Reproducibility: yes. Source inspection shows current main raw-slices the affected restart and chat boundaries, and an input like Review metrics: 1 noteworthy metric.
Stored data model 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:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the shared-helper implementation and merge only after redacted after-fix proof demonstrates the restart or web chat emoji-boundary behavior in a real setup. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main raw-slices the affected restart and chat boundaries, and an input like Is this the best way to solve the issue? Yes, the current head is the right fix shape: use the existing surrogate-safe helper at each owning boundary while preserving caps. It is not merge-ready until real behavior proof is added. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 453f5968bbca. Label changesLabel justifications:
Evidence reviewedPR surface: Source +4, Tests +62. Total +66 across 8 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 work completed:
Known gaps: none for the changed surfaces. No config, protocol, dependency, migration, or compatibility change. |
|
Merged via squash.
|
…law#101754) * fix: keep emoji intact at remaining text truncation boundaries Replace .slice(0, N) with truncateUtf16Safe() in five remaining user-visible text truncation sites that were missed by earlier UTF-16 safety sweeps: - restart.ts: restart reason text (2 sites) - chat-composer.ts: reply target text preview - chat-thread.ts: thread text preview + message text extraction All sites truncate user-generated content where emoji or other supplementary-plane characters could produce lone surrogates. Co-Authored-By: Claude <[email protected]> * fix: complete UTF-16-safe restart and chat boundaries --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Restart reasons and Control UI chat previews still had raw UTF-16 slicing boundaries. If an emoji crossed one of those caps, the returned or rendered string could end with a lone surrogate.
Why This Change Was Made
Use the existing
truncateUtf16Safeprimitive at each user-visible boundary. The maintainer fixup also makesscheduleGatewaySigusr1Restartreuse the restart module's existing reason normalizer and covers the equivalent gateway RPC boundary, so restart reasons have one consistent contract from input through persisted intent and scheduling.User Impact
Evidence
e5bab02257c814892936aac182fbf8a35cb93994.Scope
Eight files; no config, protocol, dependency, migration, or compatibility change. AI-assisted; maintainer-reviewed and expanded to the complete restart boundary.