openclaw - 💡(How to fix) Fix Discord: paragraphs split into separate messages mid-sentence with blockStreaming enabled [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#57875Fetched 2026-04-08 01:56:35
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
subscribed ×1

When blockStreamingDefault is "on" (or channels.discord.streaming: "block"), paragraphs in a single assistant response are visually split across separate Discord messages, with line breaks appearing mid-sentence. The full response is well under the 2,000-character limit.

Root Cause

When blockStreamingDefault is "on" (or channels.discord.streaming: "block"), paragraphs in a single assistant response are visually split across separate Discord messages, with line breaks appearing mid-sentence. The full response is well under the 2,000-character limit.

RAW_BUFFERClick to expand / collapse

Summary

When blockStreamingDefault is "on" (or channels.discord.streaming: "block"), paragraphs in a single assistant response are visually split across separate Discord messages, with line breaks appearing mid-sentence. The full response is well under the 2,000-character limit.

Environment

  • OpenClaw version: 2026.3.28
  • Channel: Discord (blockStreamingDefault: "on", verboseDefault: "on")
  • Provider: github-copilot/claude-opus-4.6

Steps to Reproduce

  1. Send a message that triggers a multi-paragraph response (~500-1000 chars total)
  2. Observe: individual paragraphs are delivered as separate visual blocks with gaps between them
  3. In some cases, a single paragraph is split mid-sentence across two blocks

Expected Behavior

A single assistant response under 2,000 chars should render as one contiguous Discord message, not be split into fragments.

Observed Behavior

Paragraphs and even mid-sentence text get split at chunk boundaries during streaming delivery. Each chunk renders as a visually separate block in Discord, making responses look broken.

Example: a 3-sentence paragraph ending with "...and what happens when you" gets cut, with "take trichromes into the darkroom" appearing as a separate block below.

Relation to Other Issues

  • Similar to #31679 (multi-block responses as separate messages with streaming=off) but occurs with block streaming enabled
  • Related to #57225 (delivery ordering for tool calls + text segments)
  • Not a duplicate of #26733 (typing indicator, different symptom)

extent analysis

Fix Plan

To address the issue of paragraphs being split across separate Discord messages, we need to modify the message processing logic to handle blockStreamingDefault being "on".

Here are the steps:

  • Modify the Discord message sender to buffer the entire response before sending it.
  • Implement a check to ensure the response is under the 2,000-character limit before sending.
  • Use Discord's message formatting to preserve paragraph structure.

Example code snippet (in JavaScript):

const discord = require('discord.js');

// ...

function sendMessage(response) {
  const messages = [];
  let message = '';

  // Split response into paragraphs
  const paragraphs = response.split('\n\n');

  for (const paragraph of paragraphs) {
    // Check if adding the paragraph exceeds the character limit
    if (message.length + paragraph.length > 2000) {
      messages.push(message);
      message = paragraph;
    } else {
      if (message !== '') message += '\n\n';
      message += paragraph;
    }
  }

  // Add the last message
  messages.push(message);

  // Send the messages
  for (const msg of messages) {
    // Use Discord's message formatting to preserve paragraph structure
    const embed = new discord.MessageEmbed()
      .setDescription(msg);
    channel.send({ embeds: [embed] });
  }
}

Verification

To verify the fix, send a message that triggers a multi-paragraph response and check that the response is rendered as a single contiguous Discord message.

Extra Tips

  • Ensure that the response is properly formatted to preserve paragraph structure.
  • Consider adding a check to handle responses that exceed the 2,000-character limit.
  • Test the fix with different types of responses to ensure it works as expected.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Discord: paragraphs split into separate messages mid-sentence with blockStreaming enabled [1 participants]