Group Chats: Mentions, Debounce & Reply ContextNEW
Control when the agent responds in group conversations — mention gating, group allowlists, inbound message debouncing, and reply/quote context.
An agent in a busy group chat shouldn't answer every message. Sophon gates group traffic per channel: you choose a group policy, the gate runs before any session or agent turn is created, and messages that don't pass are dropped silently — the group never sees an error, and the drop is logged with a reason (no mention, not allowlisted, policy disabled) for diagnostics.
This page covers the four pieces of group-chat behavior: group policies, mention triggers, inbound debouncing, and reply/quote context.
Group policies
Each channel carries a groupBehavior setting in its routing configuration:
| Policy | Behavior |
|---|---|
mention-only | Respond only when a mention trigger fires. Default. |
all-messages | Respond to every group message on this channel |
disabled | Never respond in groups; DMs are unaffected |
allowlist | Respond only in groups listed in allowedGroups; mention triggers still apply within those groups |
Under the allowlist policy, allowedGroups is a list of group/channel IDs. An empty list means no groups are allowed.
Personal-tier instances bypass group gating entirely and respond to all group messages, preserving the original single-user behavior. Pro and Enterprise tiers enforce mention-only by default as a secure-by-default posture.
Configuring policies
Four ways to set the policy and allowlist:
- Dashboard channel wizard — step 2 (Configure) when adding a new channel
- Edit Routing modal — on the Channels list page for existing channels
- CLI —
sophon channels routing <channel-id> --group-behavior <policy> --allow <group-id> ... - REST API —
PUT /api/channels/{id}/routingwithgroupBehaviorandallowedGroups; partial updates keep current values
Routing changes require channel owner or Admin permission.
{
"routing": {
"agentId": "default",
"dmBehavior": "main-session",
"groupBehavior": "allowlist",
"allowedGroups": ["-1001234567890", "C0123ABCDEF"]
}
}Mention triggers
Under mention-only (and within allowlisted groups), four triggers wake the agent:
| Channel | Explicit @mention | Reply to the bot | Quote of the bot | Thread participation |
|---|---|---|---|---|
| Telegram | Yes | Yes | Yes | Yes |
| Discord | Yes | Yes | Yes | Yes |
| Slack | Yes | Yes | Yes | Yes |
| Microsoft Teams | Yes | Yes | Yes | Yes |
| Matrix | Yes | Yes | Yes | Yes |
| Mattermost | Yes | Yes | Yes | Yes |
On platforms where quoting and replying are the same gesture (Telegram, Discord, Matrix), the reply and quote triggers are equivalent. Thread participation means the agent keeps responding inside a thread it has already been pulled into — you mention it once, then converse naturally. See Threads & Sessions for how those threads map to sessions.
Inbound debouncing
People type in bursts. Instead of triggering a separate agent turn for each fragment, Sophon coalesces rapid-fire messages into a single turn: the agent sees the whole burst at once and replies once, with full context.
A buffered burst flushes when the first of three conditions is met — a quiet window elapses after the last message, a hard deadline passes since the first message, or the message count cap is reached.
| Key | Default | Description |
|---|---|---|
Sophon:InboundDebounce:Enabled | true | Global switch for inbound debouncing |
Sophon:InboundDebounce:QuietWindowMs | 1500 | Milliseconds of silence after the last message before flushing |
Sophon:InboundDebounce:MaxWaitMs | 10000 | Hard cap from the first buffered message — flush regardless of quiet window |
Sophon:InboundDebounce:MaxMessages | 10 | Flush immediately once this many messages buffer |
Two per-channel overrides live in the channel's routing configuration:
| Setting | Default | Description |
|---|---|---|
debounceEnabled | null (inherit global) | Set false to disable debouncing for this channel |
debounceQuietWindowMs | null (inherit global) | Override the quiet window for this channel |
Coalescing is keyed per sender and per thread — two people typing simultaneously, or one person active in two threads, never get merged into one turn.
Reply & quote context
When someone replies to or quotes an earlier message, Sophon captures the quoted author and text and injects them ahead of the new message as a fenced context block:
Replying to [Author]: [quoted text]The agent sees what's being referenced without you re-pasting it. Reply context is also preserved in session history, so it stays visible on replay.
| Support | Channels | Notes |
|---|---|---|
| In-payload | Telegram, Discord | Quoted content arrives with the message — no extra latency |
| Fetched server-side | Slack, Mattermost, Matrix | One extra platform API call adds a small amount of latency |
| Partial | Microsoft Teams | Thread binding shipped; fetching the replied-to message body is on the roadmap |
| Planned | All other channels | Debouncing works everywhere; reply context capture is on the roadmap |
Two behaviors worth knowing:
- Quoted content is untrusted. It is wrapped inside the same external-content boundary as any other user-generated input, so instructions hidden in a quoted message do not gain authority. See Prompt Injection Defense.
- Fetch failures degrade gracefully. If a server-side lookup fails (network, permissions, rate limit), the message is processed normally without the quote — never blocked.
Where to go next
- Threads & Sessions — per-thread isolated sessions and their lifecycle
- Channels Overview — supported channels and routing basics
- Prompt Injection Defense — how external content is contained