Tutorials

Multi-account routing runbook: finish session isolation in 30 minutes

A concrete implementation checklist for channel/account/thread isolation.

Deliverable

You are done only when all are true:

  1. no cross-account context bleed
  2. no cross-thread bleed within same account
  3. logs clearly show unique session keys per conversation

Preparation (5 minutes)

Prepare two accounts and two test prompts:

  • account A sends "answer only A"
  • account B sends "answer only B"

Ensure logs include:

  • channel
  • accountId (or equivalent user ID)
  • threadId (or equivalent conversation ID)

Reference:

Implementation (20 minutes)

Step 1: define session key formula

Use at least this structure:

sessionKey = channel + ":" + accountId + ":" + threadId

Do not use channel-only or account-only keys.

Step 2: apply 3-layer partitioning

  1. channel partition
  2. account partition inside channel
  3. thread partition inside account

Step 3: run this regression matrix

Run 2 messages each for:

  1. Telegram A thread-1
  2. Telegram A thread-2
  3. Telegram B thread-1
  4. WhatsApp A thread-1
  5. WhatsApp B thread-1
  6. Discord A thread-1

Pass criteria

  • zero context crossover across all six cases
  • unique session key per case
  • failure can be traced to a specific layer

Failure mapping

  1. A receives B context
    Action: verify accountId is included in session key

  2. same account, different threads bleed
    Action: verify threadId is included in session key

  3. only one channel is affected
    Action: inspect that channel adapter payload fields first

Next content

After this tutorial, continue with: