fix(discord): keep persona names UTF-16 safe#101644
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 7, 2026, 9:25 AM ET / 13:25 UTC. Summary PR surface: Source +4, Tests +133. Total +137 across 6 files. Reproducibility: yes. from source inspection. Current main raw-slices the affected Discord persona names at 80 UTF-16 code units, and the PR adds boundary tests that exercise the surrogate-pair case. Review metrics: 1 noteworthy metric.
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 focused Discord fix, or a canonical consolidation that includes all three Discord persona-name paths, after redacted live Discord proof shows a boundary emoji persona name rendering cleanly. Do we have a high-confidence way to reproduce the issue? Yes from source inspection. Current main raw-slices the affected Discord persona names at 80 UTF-16 code units, and the PR adds boundary tests that exercise the surrogate-pair case. Is this the best way to solve the issue? Yes. Reusing the existing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e591dcfa8213. Label changesLabel justifications:
Evidence reviewedPR surface: Source +4, Tests +133. Total +137 across 6 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)
|
|
Correction: #101685 / The exact omitted fix has now landed via #103543 in |
What Problem This Solves
Fixes Discord bound-thread persona names and webhook usernames being truncated with raw UTF-16 slicing. When a name limit cuts through an emoji or other surrogate pair, the previous
.slice(0, 80)paths could leave a lone surrogate in the Discord display name.Why This Change Was Made
Discord already uses
truncateUtf16Safefor nearby thread-title and response-summary truncation. This applies the same helper to all three persona-name paths that still used raw slicing: bound-thread reply identity, outbound webhook persona username resolution, and thread-binding intro webhook persona names.User Impact
Users with emoji or non-BMP characters in agent/thread labels get clean Discord persona names instead of malformed replacement characters or invalid UTF-16 edge cases when names are truncated.
Evidence
node scripts/run-vitest.mjs extensions/discord/src/monitor/thread-bindings.persona.test.ts extensions/discord/src/monitor/reply-delivery.test.ts extensions/discord/src/outbound-adapter.test.tsgit diff --checkpython .agents\skills\autoreview\scripts\autoreview --mode local --no-web-searchautoreview clean: no accepted/actionable findings reportedStill needed for ClawSweeper proof label: