Deliverable
You are done only when all are true:
- no cross-account context bleed
- no cross-thread bleed within same account
- 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:
channelaccountId(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
- channel partition
- account partition inside channel
- thread partition inside account
Step 3: run this regression matrix
Run 2 messages each for:
- Telegram A thread-1
- Telegram A thread-2
- Telegram B thread-1
- WhatsApp A thread-1
- WhatsApp B thread-1
- 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
-
A receives B context
Action: verifyaccountIdis included in session key -
same account, different threads bleed
Action: verifythreadIdis included in session key -
only one channel is affected
Action: inspect that channel adapter payload fields first
Next content
After this tutorial, continue with: