Threads & SessionsNEW
Each platform thread gets its own isolated session — separate history and context, automatic expiry, and zero migration steps.
When a conversation moves into a thread, it usually is a separate conversation — a different topic, often with different participants. Sophon mirrors that: each platform thread gets its own isolated session, created as a child of the channel's session. The thread has its own history and its own context window, so a deep-dive in one thread never bleeds into the main channel or into other threads.
Without thread awareness, every thread on a channel would share one session — the agent would mix topics, and one long thread would crowd out everything else's context. With it, each thread reads like a clean, focused conversation.
Platform mapping
What counts as a thread depends on the platform:
| Channel | Thread unit |
|---|---|
| Slack | Thread replies under a message |
| Discord | Threads (including forum posts) |
| Telegram | Forum topics |
| Mattermost | Threaded posts (keyed by the root post) |
| Matrix | Threads |
| Microsoft Teams | Channel-thread replies (best-effort) |
Messages outside any thread continue to flow through the channel-wide session as before.
Session lifecycle
Thread sessions are created on the first threaded message and cleaned up automatically — a channel with hundreds of short-lived threads doesn't accumulate sessions forever:
- Idle expiry — a thread session with no messages for 7 days expires.
- Hard maximum age — regardless of activity, a thread session is retired after 30 days.
- Background cleanup — expired and abandoned thread sessions are removed automatically; no manual housekeeping.
Three host-level keys control the behavior:
| Key | Default | Description |
|---|---|---|
Sophon:ThreadSessions:Enabled | true | Global switch — when false, thread messages collapse into the channel-wide session |
Sophon:ThreadSessions:IdleHours | 168 | Hours without messages before a thread session expires (7 days) |
Sophon:ThreadSessions:MaxAgeHours | 720 | Hard maximum age in hours regardless of activity (30 days) |
Working with thread sessions
In the Dashboard session list, thread-bound sessions carry a Thread badge so you can tell them apart from channel-wide and DM sessions at a glance. Opening one shows only that thread's history.
Over the REST API, session summaries include two optional fields on thread-bound sessions:
threadId— the platform thread identifierparentSessionId— the channel session the thread branched from
Both are absent on regular sessions, so existing API consumers are unaffected.
Upgrades are transparent. Existing sessions keep their channel-wide behavior — no migration, no manual steps. Thread sessions only start appearing for new threaded messages after the upgrade.
Threads and message handling
Thread awareness extends to the rest of the inbound pipeline:
- Debounce coalescing is keyed per sender per thread — rapid messages in one thread are batched together, never merged with bursts from other threads or the main channel.
- Reply/quote context is captured within the thread, so the agent sees what a threaded reply refers to.
Both are covered in detail in Group Chats: Mentions, Debounce & Reply Context. Thread participation is also a mention trigger: once the agent is pulled into a thread, it keeps responding there without further @mentions.
Where to go next
- Group Chats: Mentions, Debounce & Reply Context — group policies, mention triggers, and debouncing
- Memory — what persists across sessions, including thread sessions