fix: preserve paragraph breaks between text blocks in bridge responses#144
Merged
op7418 merged 1 commit intoop7418:mainfrom Mar 5, 2026
Merged
Conversation
When Claude's response includes tool calls (Read, Edit, Bash, etc.),
the response text is split into multiple content blocks — one before
each tool call and one after. These blocks were joined with an empty
string (.join('')), causing all paragraphs to concatenate without
any spacing in the final Telegram message.
Changed .join('') to .join('\n\n') so paragraph breaks between text
blocks are preserved, matching how they appear in the desktop UI.
op7418
approved these changes
Mar 5, 2026
Owner
op7418
left a comment
There was a problem hiding this comment.
LGTM. Simple and correct fix.
.join('') → .join('\n\n') for text block assembly is the right call. When Claude's response spans multiple text blocks (interleaved with tool calls), joining without separators creates a wall of text. The \n\n separator preserves paragraph breaks.
Both the normal path and the error-recovery path are updated consistently. No side effects on the desktop UI (which uses a different rendering pipeline).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.join('')→.join('\n\n')in conversation engine's text block assembly, which was causing multi-paragraph responses to render as a single wall of text in TelegramRoot cause
When Claude's response includes tool calls (Read, Edit, Bash, etc.), the SSE stream splits the response into multiple text content blocks:
These blocks were joined with
.join('')(empty string), producing:Now joined with
.join('\n\n'):Files changed
src/lib/bridge/conversation-engine.ts.join('')→.join('\n\n')in both normal and error-recovery pathsTest plan
🤖 Generated with Claude Code