fix(imessage): keep CLI stderr tails UTF-16 safe#102626
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 9:47 AM ET / 13:47 UTC. Summary PR surface: Source +1, Tests +7. Total +8 across 2 files. Reproducibility: yes. Current main's helper still uses raw 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:
Next step before merge
Security Review detailsBest possible solution: Keep the shared-helper fix and regression test, then land after the normal exact-head CI/native prepare gates pass. Do we have a high-confidence way to reproduce the issue? Yes. Current main's helper still uses raw Is this the best way to solve the issue? Yes. The shared stderr-tail helper is the right owner-boundary fix, and using the plugin SDK text helper avoids duplicating the invariant in each caller. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0e626690cd5d. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1, Tests +7. 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 (2 earlier review cycles)
|
4ef569e to
3567bd1
Compare
|
Maintainer land-ready proof on exact head
Commands/evidence: No Messages account, database, phone number, credential, or real send was involved. That is intentional: the user-visible contract under test is the spawned CLI failure/error-tail boundary, and the exact runtime path was exercised without risking a message send. No remaining proof gaps. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
7e81331 to
eeabba8
Compare
|
Merged via squash.
|
* fix(imessage): keep CLI stderr tail truncation UTF-16 safe * test(imessage): hit stderr surrogate boundary * fix(imessage): use plugin sdk text helper --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
The iMessage CLI stderr accumulator retained its bounded tail with a raw negative UTF-16 slice. If the retained suffix began between the halves of an emoji or another supplementary character, error output could start with a lone low surrogate.
Why This Change Was Made
The shared
appendIMessageCliStderrTailowner now usessliceUtf16Safefor its suffix. That one change covers both iMessage CLI execution paths while preserving the existing cap and recent-error semantics.User Impact
Bounded iMessage CLI error details remain valid Unicode. Stderr within the limit and ASCII-only tails are unchanged.
Evidence
git diff --checkpassed.