fix(discord): keep voice log previews UTF-16 safe#99974
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 4, 2026, 10:49 AM ET / 14:49 UTC. Summary PR surface: Source +2, Tests +6. Total +8 across 2 files. Reproducibility: yes. Source inspection shows current main and v2026.6.11 cut the preview at a raw UTF-16 code-unit boundary; the PR body provides a matching terminal probe for the lone-surrogate case. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the narrow PR after normal maintainer review, keeping the existing shared helper as the single truncation primitive for this preview. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main and v2026.6.11 cut the preview at a raw UTF-16 code-unit boundary; the PR body provides a matching terminal probe for the lone-surrogate case. Is this the best way to solve the issue? Yes. Reusing the existing plugin SDK UTF-16-safe helper is the narrowest maintainable fix here; a Discord-local truncation helper would duplicate shared behavior and a broader truncation audit is separate work. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 445976ed49d0. Label changesLabel justifications:
Evidence reviewedPR surface: Source +2, Tests +6. Total +8 across 2 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)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Thank you for the contribution. This fix landed with contributor co-authorship preserved in #100258 ( I consolidated the source fixes into a maintainer takeover because the contributor branches were based on rewritten pre- |
What Problem This Solves
Fixes an issue where Discord voice diagnostics could show a broken preview character when a long transcript or response was truncated exactly inside an emoji.
Why This Change Was Made
Voice log previews now reuse the shared UTF-16-safe truncation helper while preserving the existing 500-character preview budget and ellipsis behavior.
User Impact
Operators reading Discord voice logs get stable previews without lone surrogate characters at truncation boundaries.
Evidence
node scripts/run-vitest.mjs extensions/discord/src/voice/log-preview.test.ts --reporter=verbose: 1 file / 3 tests passed.formatVoiceLogPreviewshowed the old raw slice shape leaves a lone surrogate while the patched preview does not.AI-assisted: built with Codex