fix(gmail-setup): use truncateUtf16Safe for gmail setup output truncation#102719
fix(gmail-setup): use truncateUtf16Safe for gmail setup output truncation#102719zhangqueping wants to merge 1 commit into
Conversation
…tion Replace raw UTF-16 slice in trimOutput with truncateUtf16Safe to prevent surrogate pair splitting in Gmail setup command output. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 7:41 AM ET / 11:41 UTC. Summary PR surface: Source +1. Total +1 across 1 file. Reproducibility: yes. Source inspection gives a high-confidence path: current main slices stdout/stderr at 800 UTF-16 code units, so output with a surrogate pair crossing that boundary can produce an unpaired surrogate; I did not run the live Gmail setup flow. 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 the narrow formatter change after redacted real-behavior proof is posted, ideally with a focused Gmail setup utility regression test for the surrogate-boundary output case. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection gives a high-confidence path: current main slices stdout/stderr at 800 UTF-16 code units, so output with a surrogate pair crossing that boundary can produce an unpaired surrogate; I did not run the live Gmail setup flow. Is this the best way to solve the issue? Yes. Reusing the existing exported and tested AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0bdd646fc21c. Label changesLabel 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
Review history (1 earlier review cycle)
|
|
Thanks @zhangqueping. #102823 landed the same UTF-16-safe Gmail setup output cap in |
What Problem This Solves
The Gmail setup utility uses a raw UTF-16 code-unit slice to truncate command output at 800 chars. An emoji crossing the boundary could produce an unpaired surrogate in error messages or debug output.
Why This Change Was Made
Replace
.slice(0, MAX_OUTPUT_CHARS)withtruncateUtf16SafeintrimOutput. The existing limit and ellipsis suffix remain unchanged.Files Changed
src/hooks/gmail-setup-utils.ts.slice(0,N)withtruncateUtf16SafeintrimOutput.🤖 Generated with Claude Code