How It Works
- User sends message in Chat X → Bot A
- Routing rule matches → message forwarded via Bot B to Chat Y
- BotMux saves a mapping:
(source_bot, source_chat, source_msg) ↔ (target_bot, target_chat, target_msg) - User in Chat Y replies to the forwarded message
- BotMux checks
route_mappings→ finds the original source - Reply is sent via Bot A back to Chat X
Bidirectional Tracking
Each reply creates a new mapping entry, enabling ongoing cross-bot dialogs without losing context.Loop Protection
Messages originating from bots (not users) are not reverse-routed, preventing infinite loops.Storage
Route mappings are stored in theroute_mappings SQLite table with RouteID=0 for LLM-generated routes.