Problem
A long finalized user message can acquire a replacement character in its folded terminal preview when the first prose line is cut between the two UTF-16 halves of an emoji or other supplementary character.
Current main: f6b49ae59605b1276b8267f2886d22c03f01533c. Reproduced on the source checkout with Node 22.22.3 on Windows.
Reproduction
Send a user message with a first line consisting of 1,199 ASCII characters followed by an emoji and more text, followed by at least 21 additional lines. This reaches the normal finalized-user Markdown transformer and its 1,200-code-unit prose cutoff.
The returned preview ends that prefix with an orphaned high surrogate. Encoding the rendered text as UTF-8 and reading it back introduces a replacement character. An astral CJK character at the same boundary reproduces the same failure.
Expected: omit the entire boundary character if it cannot fit, without increasing the existing preview budget. A complete pair that fits should remain intact.
This affects the folded display only; the original message sent to the model and stored in the Session is not claimed corrupted. No changes to folding thresholds, code fences, or grapheme-cluster policy are proposed.
Problem
A long finalized user message can acquire a replacement character in its folded terminal preview when the first prose line is cut between the two UTF-16 halves of an emoji or other supplementary character.
Current main:
f6b49ae59605b1276b8267f2886d22c03f01533c. Reproduced on the source checkout with Node 22.22.3 on Windows.Reproduction
Send a user message with a first line consisting of 1,199 ASCII characters followed by an emoji and more text, followed by at least 21 additional lines. This reaches the normal finalized-user Markdown transformer and its 1,200-code-unit prose cutoff.
The returned preview ends that prefix with an orphaned high surrogate. Encoding the rendered text as UTF-8 and reading it back introduces a replacement character. An astral CJK character at the same boundary reproduces the same failure.
Expected: omit the entire boundary character if it cannot fit, without increasing the existing preview budget. A complete pair that fits should remain intact.
This affects the folded display only; the original message sent to the model and stored in the Session is not claimed corrupted. No changes to folding thresholds, code fences, or grapheme-cluster policy are proposed.