OpenProgram Docs

Chat-bot behaviour on channels

A chat bot is the same Agent with the same runtime, tools and memory, behind a room layer (which messages become turns) and a delivery layer (how replies leave), both in channels/. OpenClaw and Hermes are built the same way.

What a room needs

NeedWhy a chat differs
Know who spokeA group or a session_scope: main agent puts several people in one conversation
Stay quiet by defaultMost group messages are people talking to each other
Still hear the roomA question after "@bot" depends on the messages before it
Decide to speakUseful assistants join when they have something to add
Reply like a personShort paragraphs as they are ready, typing indicator, no tool transcript
Limit strangersTools that touch the owner's machine stay with the owner
Not talk to bots foreverTwo bots answer each other until something stops them
One person across appsThe same person on WeChat and Telegram is one subject for memory
Speak firstReminders, follow-ups, check-ins

Reference systems

SystemEmphasis
OpenClawThe most complete room layer: groups, ambient rooms, sessions, streaming, typing, bot loop protection
Hermes Agent (repo)What the bot learns: self-curated MEMORY.md and USER.md, nudges to save, new skills from solved tasks, full-text recall. One gateway, about twenty platforms, one identity across them; scheduled jobs deliver anywhere.
PokeLives in iMessage and SMS, fixed voice, texts first when mail or calendar needs attention, treats those accounts as memory. Speaking first and personality make it feel present.
OpenClaw's pieces
  • Access: DM pairing, allowlists; groupPolicy allowlist, open or disabled per group.
  • Mention gating: requireMention, mentionPatterns, reply-to-bot counts; /activation mention|always.
  • Pending history: unmentioned messages kept (historyLimit, default 50) for the next triggered turn.
  • Ambient rooms: unmentionedInbound: "room_event" with visibleReplies: "message_tool": every message reaches the agent, final text stays private, the room hears only the message tool; typing suppressed.
  • Per-group and per-sender tool policy (tools, toolsBySender); sandbox for non-main sessions.
  • Sessions: dmScope, identityLinks, daily or idle reset, /new, /reset.
  • Delivery: block streaming (minChars, maxChars, coalescing, newline mode), preview edits, typing keepalive, ack reactions.
  • Bot loop protection, one-time group introduction, heartbeats that skip groups, voice-note transcription, media both ways.
  • WeChat: plugin by Tencent's Weixin team; direct chats and media, no groups, iLink QR login.
CapabilityOpenClawOpenProgram
Platforms34, WeChat by pluginTelegram, Discord, Slack, WeChat (iLink)
DM pairing, allowlistYesYes
Sender identity to the modelText label plus metadata blockStructured speaker_* fields
Sender in the web transcript—Platform and sender above the bubble
Mention gatingAll groups, patterns, reply-to-botTelegram, Discord, Slack; reply-to-bot; no custom patterns
/activation, /new, /resetYesYes
Pending group historyYesYes
Ambient roomsYes/activation ambient, chat_send
Tool policy per group or senderYesPer-account sender_access; per-user group lists (full or chat), per account or group; /memory; asker-only answers
Session scope, resetYessession_scope, daily or idle
Cross-channel identity linksYesNo
Live progressPreview editsPlaceholder edited with tool steps
Paragraph chunking while runningYesWeChat; edit-capable platforms keep the placeholder
Typing indicatorYesTelegram, Discord, WeChat
Ack reactionYesTelegram, Discord, Slack (ack_reaction)
Bot loop protectionYesBot messages dropped, per-room turn limit
Group introductionYesNo
Media in and outYesYes
Voice transcriptionYesWeChat's own transcript; untranscribed voice kept as SILK
Questions back to the user—/answer, /decline
Proactive deliveryHeartbeats, cronAlways-on agents deliver to a channel
Self-curated memory, skillsHermesShared memory workspace, per-person topics

Room modes

ModeStarts a turnOther messagesReply reaches the room
mention (default)Mention, or reply to the botPending historyYes
alwaysEvery message—Yes
ambientEvery message—Addressed: yes. Otherwise only through chat_send.
  • A non-addressing ambient message opens with [room event], runs no ack or typing, and its final text stays in the transcript, labelled "overheard" on the web. Room events count against the flood limit.
  • The account's require_mention gives the default; /activation stores a per-group override in rooms.json. Adapters only set ChannelMessage.mentioned and strip the mention; channels/inbound/_room.py decides, the same on every platform. Direct messages are never gated.
  • chat_send(text) posts into the turn's chat, looked up by session key in channels/inbound/_active_turns.py (a session_scope: main session holds several chats). Needs only reply, is on the safe auto-allow list, is hidden from non-channel sources, at most five per turn. In an addressed turn it serves a short note before long work; the final reply is still posted.

Pending history

[earlier messages in this chat]
> {"speaker": "...", "content": "..."}
> {"speaker": "...", "content": "..."}
  • Kept in memory per room with speaker fields. The next turn takes the newest 50 ahead of its message. JSON escapes newlines, so a pending message cannot forge another speaker's line.
  • Consumed entries are cleared; /new clears; a worker restart drops them. It never wakes the agent. The web folds the block at the top of the bubble.

Delivery

ElementBehaviour
TypingRuns the whole turn. Telegram sendChatAction every 4 s, Discord every 8 s, WeChat every 5 s. WeChat needs a ticket from iLink getconfig with the user's latest context_token; the turn's end sends iLink's cancel.
No-edit platforms (WeChat)A chunk leaves at a blank line once it has 200 characters; the buffer leaves when a tool call starts; open code fences are never split; no chunk exceeds the cap. The final reply, with send_file markers, supplies the rest.
Edit platformsKeep the live placeholder
Ack reactionOptional, marks a message picked up
Tool stepsNever in ambient mode, never on WeChat

Who may do what

SenderGroup resultTurn runs asRoom commands
On the allowlist, or group_full_accessfullsender_access tierAllowed
On group_chat_onlychatpaired tier/new, /reset, /activation, /memory refused
Anyone else, or no user iddroppedNo reply, code, pending entry or session; worker log records the id—

_access.group_sender_access decides from the stable user id and never writes. In a direct message, allowlisted senders take the sender_access tier.

sender_accessWhole-account ceiling
owner (default)The owner's principal and tier with interactive approvals; session permission mode and rules apply. Approvals reach the chat as questions, answered with /answer. Speaker fields still name the sender.
pairedReplying, chat_send and memory, in groups too; files, shell and network tools refused
/memoryTurnRequest.memory_policy_override, narrowing only
onThe agent's own setting
readHides the writing tools
offStops recall, hides memory tools
  • Lists live in the account's access.json. A group may hold its own pair beside its activation in rooms.json; once present they replace the account's, only reset removes them, and emptying them leaves the group closed.
  • A Discord thread has its own chat id and falls back to its parent channel's lists.
  • The allowlist applies to every group, so listing a bound contact as chat is refused, and binding someone removes them from the chat lists.
  • Lists change only from the local CLI and settings page. CLI and worker both write rooms.json, under the same cross-process file lock as access.json.
  • A question from runtime.ask belongs to the person who started the turn; in a group /answer and /decline from anyone else are refused while it runs.

Loops and floods

Bot messages are dropped. A room starts at most 10 turns in a sliding minute; past that, messages fall into pending history. One message delivered twice (Slack message and app_mention) starts one turn.

WeChat

DirectionBehaviour
Inbound mediaiLink image, voice, file and video items point at AES-128-ECB objects on Tencent's C2C CDN and carry the key. They become attachments with the key; the shared path decrypts while downloading. The CDN says application/octet-stream, so image type comes from the decrypted header.
VoiceWeChat's transcript becomes the text, with no download. Without one it is SILK, saved as voice.silk.
Sending a filegetuploadurl, encrypt with a fresh key, post to the CDN, send an image, video or file item naming the download parameter and key. A caption follows as its own text. Uses the channel.wechat.cdn HTTP consumer, fixed to the CDN origin.
LimitsNo groups or edits: always paragraph chunking, never the placeholder

Implementation status

StateItems
ImplementedPairing, allowlist; structured speaker identity; session scope and reset; room modes; pending history; ambient and chat_send; typing; WeChat chunking; ack reactions; sender_access; group lists; room memory; asker-only answers; bot dropping; turn limit; duplicate suppression; live placeholder; per-platform markdown and cap splitting; attachments on all four platforms; /answer, /decline; always-on delivery
Designed, not implementedCustom mention patterns. Identity links: channel:speaker_id pairs map to one person id, memory files them under one topic, and a binding may give a linked person one direct session. Channel persona in the agent profile (voice, length, emoji), for channel turns only. Memory-scheduled follow-ups delivered to the person's last active channel, with heartbeats skipping groups. Group introductions. Transcribing voice with no platform transcript (WeChat SILK, Telegram and Discord notes).
Last updated · 2026-11-25