Skip to content

Fix streaming to preserve whitespace chunks in chat UI template#636

Merged
crmne merged 1 commit intocrmne:mainfrom
kryzhovnik:fix/streaming-blank-check
Feb 26, 2026
Merged

Fix streaming to preserve whitespace chunks in chat UI template#636
crmne merged 1 commit intocrmne:mainfrom
kryzhovnik:fix/streaming-blank-check

Conversation

@kryzhovnik
Copy link
Contributor

Summary

String#blank? drops whitespace-only chunks (newlines, spaces) during streaming. LLM output can include content where whitespace is significant for correct rendering (e.g. Markdown), so use String#empty? instead to only skip truly empty chunks.

Replaces #537 (was opened from main by mistake).

String#blank? drops whitespace-only chunks (newlines, spaces) during
streaming. LLM output can include content where whitespace is significant
for correct rendering (e.g. Markdown), so use String#empty? instead to
only skip truly empty chunks.
@crmne
Copy link
Owner

crmne commented Feb 26, 2026

Good catch!

@crmne crmne merged commit bdacce8 into crmne:main Feb 26, 2026
1 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants