fix: align commands, batching, reactions, and LRU with forcePerChat

Address review findings from self-review and codex:

- Commands (/reset, /cancel) now receive forcePerChat from the Discord
  adapter and resolve the correct per-thread conversation key
- Group batcher propagates forcePerChat to synthetic batch messages so
  debounced thread messages don't fall back to shared routing
- Reaction handler sets forcePerChat for thread-only reactions
- Session LRU eviction fires regardless of conversationMode so
  forcePerChat sessions don't accumulate without bounds
- Docs now correctly state thread-only overrides shared/per-channel
  modes (not disabled mode)

Written by Cameron ◯ Letta Code

"The best way to predict the future is to implement it." -- David Heinemeier Hansson
This commit is contained in:
Cameron
2026-03-09 18:40:09 -07:00
parent b79f29d8fa
commit be60a00057
8 changed files with 22 additions and 15 deletions

View File

@@ -461,7 +461,7 @@ channels:
Thread messages inherit parent channel config, so child threads under `EZRA_CHANNEL_ID` use the same group rules.
When `threadMode: thread-only` is set, each thread automatically gets its own isolated conversation (message history), regardless of the global `conversations.mode` setting. This prevents messages from different threads from being interleaved in the same conversation. Agent memory (blocks) is still shared across all threads.
When `threadMode: thread-only` is set, each thread automatically gets its own isolated conversation (message history). This overrides `shared` and `per-channel` conversation modes so that messages from different threads are never interleaved. Agent memory (blocks) is still shared across all threads. (In `disabled` mode, all messages use the agent's built-in default conversation and thread isolation does not apply.)
### Finding Group IDs

View File

@@ -209,7 +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.
- Each thread gets its own isolated conversation (message history), overriding `shared` and `per-channel` conversation modes. This prevents crosstalk between threads. Agent memory (blocks) is still shared.
Required Discord permissions for auto-create: