fix(discord): isolate conversations per-thread in thread-only mode

Thread-only mode previously relied on the global conversationMode to
determine whether threads got separate conversations. In shared or
per-channel mode, all threads shared one conversation causing crosstalk.

Add forcePerChat flag on InboundMessage that the Discord adapter sets
when thread-only mode is active. resolveConversationKey treats flagged
messages as per-chat regardless of the configured mode, giving each
thread its own isolated conversation while still sharing agent memory.

Written by Cameron ◯ Letta Code

"Time is an illusion. Lunchtime doubly so." -- Douglas Adams
This commit is contained in:
Cameron
2026-03-09 18:25:09 -07:00
parent 4d037aca6a
commit b79f29d8fa
6 changed files with 43 additions and 12 deletions

View File

@@ -209,6 +209,7 @@ Behavior summary:
- Top-level messages are ignored in `thread-only` mode.
- Top-level @mentions create a thread and are answered in that thread when `autoCreateThreadOnMention` is enabled.
- Thread messages inherit parent channel config. If `EZRA_CHANNEL_ID` is configured, replies in its child threads use that same config.
- Each thread gets its own isolated conversation (message history), regardless of the global `conversations.mode` setting. This prevents crosstalk between threads. Agent memory (blocks) is still shared.
Required Discord permissions for auto-create: