fix(tasks): keep completion failure reason truncation UTF-16 safe#101616
fix(tasks): keep completion failure reason truncation UTF-16 safe#101616wm0018 wants to merge 1 commit into
Conversation
String.prototype.slice at offset 159 can split surrogate pairs in task completion failure reasons, producing broken U+FFFD in terminal output and task registry views. Replace raw slice(0, 159) with truncateUtf16Safe.
|
Codex review: needs real behavior proof before merge. Reviewed July 7, 2026, 8:00 AM ET / 12:00 UTC. Summary PR surface: Source +1, Tests +29. Total +30 across 2 files. Reproducibility: yes. source inspection plus a focused Node check shows the current raw slice can leave a lone high surrogate at the claimed boundary. I did not run a full task-completion UI flow for this review. 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: Merge the narrow helper-based fix after contributor or maintainer proof shows a real task-completion failure reason with an emoji boundary renders cleanly, ideally with a public resolver regression assertion added. Do we have a high-confidence way to reproduce the issue? Yes, source inspection plus a focused Node check shows the current raw slice can leave a lone high surrogate at the claimed boundary. I did not run a full task-completion UI flow for this review. Is this the best way to solve the issue? Yes, using the existing truncateUtf16Safe helper at the failure-reason normalization point is the narrowest maintainable fix. The validation would be stronger if it asserted resolveRequiredCompletionDeliveryFailureTerminalResult output rather than only the helper. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2ba622ca3019. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1, Tests +29. Total +30 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
|
|
Thanks @wm0018. The useful behavior from this PR was consolidated with the sibling UTF-16 boundary fixes into #101654 and landed on The landed fix uses the existing |
What Problem This Solves
Fixes an issue where task completion failure reasons could render broken U+FFFD replacement characters (
�) when the failure reason contained an emoji or CJK supplementary character at the 159-character truncation boundary.normalizeCompletionFailureReasoncaps failure reasons at 160 chars vianormalized.slice(0, 159).String.prototype.slicecuts at UTF-16 code unit boundaries — emoji like 🚀 are surrogate pairs (2 code units) and get split.Why This Change Was Made
Replace
normalized.slice(0, 159)withtruncateUtf16Safe(normalized, 159)— the standard helper already used insrc/tasks/task-status.ts(same directory).User Impact
Task completion failure reasons containing emoji or CJK near the 160-character limit now display cleanly truncated text.
Evidence
Tests
Files Changed (2 files, +31/-1)