AntFleet

Disagreement · 70b30f32-anthropic-0

formatPRComment truncation can cut a multi-byte character / leave dangling whitespace mid-word

solo Opus
repo e24ef98c·PR #8·reviewed 1 week ago

Opus finding

formatPRComment truncation can cut a multi-byte character / leave dangling whitespace mid-word

lowbugmedium
  • apps/web/lib/pr-comment.ts:60-63
truncate slices on UTF-16 code units. If a finding's reasoning contains a surrogate-pair character (emoji, some CJK, math symbols) exactly at position n-1, the slice will produce a lone surrogate and the resulting Markdown will contain an invalid Unicode character. This is a minor robustness issue rather than a correctness break, but it affects user-facing review comments that may quote source code with non-BMP characters.

Recommendation

Use Array.from(s) or Intl.Segmenter to count graphemes/code points, or guard with isHighSurrogate before slicing.

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →