Messages
This page ties together how Clawdbot handles inbound messages, sessions, queueing, streaming, and reasoning visibility.Message flow (high level)
messages.*for prefixes, queueing, and group behavior.agents.defaults.*for block streaming and chunking defaults.- Provider overrides (
whatsapp.*,telegram.*, etc.) for caps and streaming toggles.
Sessions and devices
Sessions are owned by the gateway, not by clients.- Direct chats collapse into the agent main session key.
- Groups/channels get their own session keys.
- The session store and transcripts live on the gateway host.
Inbound bodies and history context
Clawdbot separates the prompt body from the command body:Body: prompt text sent to the agent. This may include provider envelopes and optional history wrappers.CommandBody: raw user text for directive/command parsing.RawBody: legacy alias forCommandBody(kept for compatibility).
[Chat messages since your last reply - for context][Current message - respond to this]
CommandBody (or
RawBody) to the original message text and keep Body as the combined prompt.
History buffers are configurable via messages.groupChat.historyLimit (global
default) and per-provider overrides like slack.historyLimit or
telegram.accounts.<id>.historyLimit (set 0 to disable).
Queueing and followups
If a run is already active, inbound messages can be queued, steered into the current run, or collected for a followup turn.- Configure via
messages.queue(andmessages.queue.byProvider). - Modes:
interrupt,steer,followup,collect, plus backlog variants.
Streaming, chunking, and batching
Block streaming sends partial replies as the model produces text blocks. Chunking respects provider text limits and avoids splitting fenced code. Key settings:agents.defaults.blockStreamingDefault(on|off, default off)agents.defaults.blockStreamingBreak(text_end|message_end)agents.defaults.blockStreamingChunk(minChars|maxChars|breakPreference)agents.defaults.blockStreamingCoalesce(idle-based batching)agents.defaults.humanDelay(human-like pause between block replies)- Provider overrides:
*.blockStreamingand*.blockStreamingCoalesce(non-Telegram providers require explicit*.blockStreaming: true)
Reasoning visibility and tokens
Clawdbot can expose or hide model reasoning:/reasoning on|off|streamcontrols visibility.- Reasoning content still counts toward token usage when produced by the model.
- Telegram supports reasoning stream into the draft bubble.
Prefixes, threading, and replies
Outbound message formatting is centralized inmessages:
messages.responsePrefix(outbound prefix) andwhatsapp.messagePrefix(WhatsApp inbound prefix)- Reply threading via
replyToModeand per-provider defaults