skip to content

Why does an OpenClaw agent's reply reach a chat app as a finished message or a few blocks rather than streaming token by token?

level: juniorimportance: should knowfreq 7%

answer

  1. no token deltas into channels
  2. two independent layers
  3. block streaming off by default
  4. per-channel preview streaming mode
  5. long text split, not cut

basics

~20 s

OpenClaw never streams token deltas into channel messages. Block streaming, which sends finished chunks as separate messages, is off by default, and live previews depend on each channel's streaming mode, so most replies arrive complete.

solid answer

~30 s

OpenClaw streams the model's output internally, but it has **no token-delta streaming to channel messages**. Two independent layers decide what the user sees. **Block streaming** sends completed chunks as normal messages; it is governed by `agents.defaults.blockStreamingDefault`, which is `"off"` by default, plus `blockStreamingBreak` (`text_end` emits as you go, `message_end` flushes when the message finishes) and a per-channel `streaming.block.enabled`. **Preview streaming** edits one temporary message on channels that support editing, set by `channels.<channel>.streaming.mode` (`off`, `partial`, `block` or `progress`); Telegram and Slack default to `progress`, Discord to `off`. Long replies are split at the channel's `textChunkLimit` rather than truncated.

code

json · 13 lines
json
{
  "agents": {
    "defaults": {
      "blockStreamingDefault": "on",
      "blockStreamingBreak": "text_end"
    }
  },
  "channels": {
    "discord": {
      "streaming": { "block": { "enabled": true } }
    }
  }
}

go deeper

for a junior

Recall that chat apps never get token-by-token text from OpenClaw, and that block streaming is off unless you turn it on.

for a middle

Explain the two layers, block streaming under agents.defaults and preview streaming per channel, with their default values and the text_end versus message_end break.

for a senior

Untangle confusing delivery reports, such as previews versus block replies, the block-mode naming trap and chunk splitting, and tune coalescing so streaming does not spam a busy channel.

for a principal

Decide per channel whether live output is worth the extra messages and notifications, and keep the streaming defaults consistent across channels the same people use.

## No token streaming into chat messages Users coming from a web chat interface expect to watch an answer appear word by word. OpenClaw's model output does stream internally as `assistant` events, but there is **no true token-delta streaming into channel messages**. What reaches WhatsApp, Telegram, Slack or Discord is shaped by two independent layers, and both are conservative by default. ## Layer one: block streaming **Block streaming** sends completed chunks of the answer as normal, separate channel messages while the agent is still writing. It is controlled under `agents.defaults`, not at the config root: | Key | Values | Default | | --- | --- | --- | | `blockStreamingDefault` | `"on"` / `"off"` | `"off"` | | `blockStreamingBreak` | `"text_end"` / `"message_end"` | not set | | `blockStreamingChunk` | `{ minChars, maxChars, breakPreference? }` | not set | | `blockStreamingCoalesce` | `{ minChars?, maxChars?, idleMs? }` | not set | How the break setting behaves: - `text_end` emits blocks as soon as the chunker produces them, flushing on each text end. - `message_end` waits until the assistant message finishes, then flushes; a very long answer can still go out as several chunks. Channels can override the default with `channels.<id>.streaming.block.enabled`, and non-Telegram channels need it set to `true` to stream chunks. The chunker never splits inside a code fence, prefers paragraph, then newline, then sentence breaks, and is clamped to the channel's `textChunkLimit` (4000 by default). ## Layer two: preview streaming Channels that can edit a message, such as Telegram, Discord, Slack, Mattermost and Microsoft Teams, can show a **live preview** that is updated while the agent works. That is set per channel with `channels.<channel>.streaming.mode`: - `off`: no preview; - `partial`: one preview replaced with the latest text; - `block`: the preview updates in chunked or appended steps; - `progress`: a progress or status preview during generation, with the final answer delivered at completion. When `streaming` is unset, Discord defaults to `off`, Telegram and Slack to `progress`, and Mattermost and Microsoft Teams to `partial`. Note the naming trap: `streaming.mode: "block"` is a preview mode on Discord and Telegram and does not enable separate block replies there; `streaming.block.enabled` does that. ## Why most replies arrive finished Put together, an install with no streaming configuration behaves like this: 1. The model streams internally, but block streaming is off, so no partial messages are sent. 2. On a channel with a preview default, such as Telegram's `progress`, the user may see a status draft while the agent works, then the final answer. 3. On a channel without preview support, the user sees a typing indicator where the channel supports one, then the final answer. 4. A reply longer than the channel's limit is split into several messages rather than cut off. ## Turning it on deliberately To stream chunks as they are written, set `blockStreamingDefault: "on"` with `blockStreamingBreak: "text_end"`, and enable `streaming.block.enabled` on the channel. Expect side effects: - many short messages, which coalescing reduces by merging chunks until an idle gap (Discord, Signal and Slack default to `minChars: 1500` and `idleMs: 1000`); - more notifications for the recipient; - a mid-run correction that looks like several separate replies. `agents.defaults.humanDelay.mode: "natural"` adds a random 800 to 2500 ms pause between block replies if the burst feels robotic. ## Common misreadings - **"The bot is slow because it is not streaming."** Streaming changes when text appears, not how long the run takes; a slow reply is usually queueing, tools or the model, visible in the run's events and logs. - **"Block mode in the channel streaming settings gives me block replies."** On Discord and Telegram it only changes how the preview is updated; separate messages need `streaming.block.enabled`. - **"Turning on block streaming everywhere is harmless."** On a busy group channel it multiplies messages and notifications, and on channels with a preview default the two layers can compete, which is why Discord and Telegram skip preview streaming when block streaming is explicitly enabled. - **"Legacy keys still work."** Older flat spellings such as `streamMode` or a boolean `streaming` are not read at runtime; `openclaw doctor --fix` rewrites them into the nested `streaming.mode` shape.

  • In OpenClaw, what is the difference between `streaming.mode: "block"` and `streaming.block.enabled` on a channel?
    `streaming.mode: "block"` is a preview-streaming mode: on edit-capable channels such as Discord and Telegram it updates the temporary preview in chunked steps and does not enable separate block replies there. `streaming.block.enabled: true` turns on block delivery, where completed chunks are sent as normal messages. Microsoft Teams is the exception: its `block` mode disables native streaming and delivers regular blocks.
  • How do you stop OpenClaw block streaming from arriving as a burst of one-line messages?
    Use coalescing: `agents.defaults.blockStreamingCoalesce` or a channel's `streaming.block.coalesce` merges consecutive chunks until an idle gap (`idleMs`), with `minChars` holding back tiny fragments and `maxChars` capping the buffer. Discord, Signal and Slack default to `minChars: 1500` and `idleMs: 1000`. `agents.defaults.humanDelay.mode: "natural"` additionally adds a random 800 to 2500 ms pause between block replies.

  • OpenClaw sends each model token to the chat as it is generated.
  • Block streaming is switched on by default for every channel.
  • Setting streaming.mode to block turns on separate block replies on Discord.
  • A reply longer than the channel limit gets truncated.
  • The blockStreaming keys belong at the root of openclaw.json.