i'm viewing a chat replay and i see that we are somehow parsing a comma and turning it into a newline in the chat display. this is the final event output but we build up the chat with deltas so the user can see the info streaming in. what is happening here?
{
"timestamp": "2026-02-17T21:16:00.224Z",
"type": "response_item",
"payload": {
"type": "message",
"role": "assistant",
"content": [
{
"type": "output_text",
"text": "The active RFC is currently just a blank template, so I’m inspecting project architecture and existing RFC patterns to produce a concrete, repo-aligned plan with defaults filled in."
}
],
"phase": "commentary"
}
} {
"timestamp": "2026-02-17T21:16:00.223Z",
"type": "event_msg",
"payload": {
"type": "agent_message",
"message": "The active RFC is currently just a blank template, so I’m inspecting project architecture and existing RFC patterns to produce a concrete, repo-aligned plan with defaults filled in."
}
}
[Image: source: /Users/josh/Library/Application Support/CleanShot/media/media_VTK6nLMAGe/CleanShot 2026-02-17 at 14.31.40@2x.png]
Found it. The issue is in the rendering layer. Let me look at the exact code.
Here's the problem. In ChatMessageList.tsx:27-43, the splitSentences() function has a comma-splitting fallback:
The text in your example is a single sentence (one period at the end), so the first regex split produces only 1 part. It then falls through to the comma fallback, which splits on , so and , repo-aligned.
Then paragraphize() (line 65) groups those comma-split fragments into separate paragraphs, which renders them on separate lines with gaps between them.
The comma fallback was probably intended to break up long comma-separated lists, but it's incorrectly breaking up normal prose that happens to have commas. The fix is to remove or restrict that comma-splitting fallback. What would you like to do — remove it entirely, or restrict it to only fire when there are many comma-separated items (like 4+)?
where did splitSentences come from in the commit history?
It was introduced by Ayman on Feb 12 in commit d7e1205 ("Update ChatMessageList.tsx"). The entire splitSentences, collapseNearDuplicateSentences, paragraphize, and normalizeSentence suite was added in that single commit.
The intent was to break up long assistant messages into readable paragraphs — splitting first on sentence boundaries (.!?), then falling back to comma splitting when there's only a single sentence. The comma fallback is what's causing your bug: single-sentence prose with commas gets split into separate paragraph blocks.
what other commits happened around then
It was part of a UI polish sprint on Feb 12. The sequence that day was:
bdac0d3 — "take ai response out of text bubble"d7e1205 — "Update ChatMessageList.tsx" (introduced splitSentences + paragraphize)f669a99 — "take ai response out of text bubble" (duplicate on another branch)e85c5b6 — "Update ChatMessageList.tsx" (duplicate)8c1fa19 / fa30536 — "chat appearance"4b85ea5 / 2581f4b — "move disambiguation into inline chat"It looks like Ayman was restyling the chat — removing the bubble/card treatment for assistant messages and switching to a more open layout. The splitSentences/paragraphize logic was added as part of making the bubble-less text more readable by breaking long blocks into visual paragraphs. The comma fallback was likely meant to handle cases where the AI produces a single long sentence, but it's too aggressive for normal prose.