fix(wrap): resolve DM participants for correct routing

Merged
KH
8mo ago
+179-61

Summary

  • DMs with conv_/dm_ conversation-ID targets were being delivered to all wrapped agents instead of only the intended recipient
  • Now resolves DM participants via Relaycast API with 30s cache (same pattern as main.rs) and only delivers if the wrapped agent is a participant
  • Fixes case-insensitive matching for self-echo filtering and direct target checks — previously used exact HashSet::contains which missed differently-cased names

Root cause

PR #641 added a DM routing filter but whitelisted conv_/dm_ prefixed targets as pass-through. Since Relaycast delivers most DMs with conversation_id as the target (not the agent name), every wrapped agent received every DM.

Test plan

  • Send a DM to a specific agent in Superset — only that agent should receive it
  • Send a channel message — all subscribed agents should receive it
  • cargo test --all passes (516 tests green)

šŸ¤– Generated with Claude Code


Open with Devin