Sophon Docs
Channels

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:

PolicyBehavior
mention-onlyRespond only when a mention trigger fires. Default.
all-messagesRespond to every group message on this channel
disabledNever respond in groups; DMs are unaffected
allowlistRespond 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
  • CLIsophon channels routing <channel-id> --group-behavior <policy> --allow <group-id> ...
  • REST APIPUT /api/channels/{id}/routing with groupBehavior and allowedGroups; 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:

ChannelExplicit @mentionReply to the botQuote of the botThread participation
TelegramYesYesYesYes
DiscordYesYesYesYes
SlackYesYesYesYes
Microsoft TeamsYesYesYesYes
MatrixYesYesYesYes
MattermostYesYesYesYes

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.

KeyDefaultDescription
Sophon:InboundDebounce:EnabledtrueGlobal switch for inbound debouncing
Sophon:InboundDebounce:QuietWindowMs1500Milliseconds of silence after the last message before flushing
Sophon:InboundDebounce:MaxWaitMs10000Hard cap from the first buffered message — flush regardless of quiet window
Sophon:InboundDebounce:MaxMessages10Flush immediately once this many messages buffer

Two per-channel overrides live in the channel's routing configuration:

SettingDefaultDescription
debounceEnablednull (inherit global)Set false to disable debouncing for this channel
debounceQuietWindowMsnull (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.

SupportChannelsNotes
In-payloadTelegram, DiscordQuoted content arrives with the message — no extra latency
Fetched server-sideSlack, Mattermost, MatrixOne extra platform API call adds a small amount of latency
PartialMicrosoft TeamsThread binding shipped; fetching the replied-to message body is on the roadmap
PlannedAll other channelsDebouncing 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