P1: Verify Shared Thread Sessions (Multi-User Discord/Telegram) #121

Open
opened 2026-04-06 14:08:22 +00:00 by Timmy · 0 comments
Owner

Context

Commit 89c812d1 makes threads (Telegram forum topics, Discord threads, Slack threads) shared by default. Multiple users in a thread now share the same conversation.

Key changes:

  • build_session_key(): thread_id present = user_id not appended to session key
  • Sender attribution: [sender name] prefix on messages
  • System prompt: shows 'Multi-user thread' note
  • Config opt-out: thread_sessions_per_user: true

Acceptance Criteria

  • Verify shared session in Discord: Create a thread in Discord, have two users interact, confirm both see the same conversation context
  • Verify shared session in Telegram: Open a forum topic, have two users interact, confirm shared context
  • Verify sender attribution: Messages from different users are prefixed with [sender name] in the agent's context
  • Verify per-user isolation still works in non-threaded groups: Group DMs without threads should still isolate by user (unchanged behavior)
  • Verify opt-out config: Set thread_sessions_per_user: true, confirm threads revert to per-user isolation

Why This Matters

Collaborative work requires shared context. When multiple team members discuss an issue in a thread, the agent needs the full conversation, not fragmented per-user sessions.

Hints

  • Session key logic in gateway/session.pybuild_session_key()
  • Config option: thread_sessions_per_user in gateway config

Parent: #111

## Context Commit `89c812d1` makes threads (Telegram forum topics, Discord threads, Slack threads) shared by default. Multiple users in a thread now share the same conversation. Key changes: - `build_session_key()`: thread_id present = user_id not appended to session key - Sender attribution: `[sender name]` prefix on messages - System prompt: shows 'Multi-user thread' note - Config opt-out: `thread_sessions_per_user: true` ## Acceptance Criteria - [ ] **Verify shared session in Discord**: Create a thread in Discord, have two users interact, confirm both see the same conversation context - [ ] **Verify shared session in Telegram**: Open a forum topic, have two users interact, confirm shared context - [ ] **Verify sender attribution**: Messages from different users are prefixed with [sender name] in the agent's context - [ ] **Verify per-user isolation still works in non-threaded groups**: Group DMs without threads should still isolate by user (unchanged behavior) - [ ] **Verify opt-out config**: Set `thread_sessions_per_user: true`, confirm threads revert to per-user isolation ## Why This Matters Collaborative work requires shared context. When multiple team members discuss an issue in a thread, the agent needs the full conversation, not fragmented per-user sessions. ## Hints - Session key logic in `gateway/session.py` — `build_session_key()` - Config option: `thread_sessions_per_user` in gateway config Parent: #111
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/hermes-agent#121