Architecture: Should WAHA (personal WhatsApp) replace Twilio or coexist as...
Documentation for Sessions
🏗️ Architecture: Should WAHA (personal WhatsApp) replace Twilio or coexist as...
Date: 2026-03-21
Time: 17:13:49 UTC
Session: gspace1-250.4
Agent: backend
Confidence: 93%
Status: ✅ Documented
📋 Decision Context
Question:
Should WAHA (personal WhatsApp) replace Twilio or coexist as a separate channel?
Task: S250: WAHA personal WhatsApp channel design
🎯 Decision Made
Chosen:
Coexist as a new channel type 'whatsapp_personal' alongside existing Twilio 'whatsapp'. Twilio remains the business channel for formal/transactional messaging. WAHA runs on Hetzner as Vitto's personal identity. Automatic fallback: business channel first, on 63016 error (outside session window), retry via WAHA personal channel.
Options Considered:
- Replace Twilio entirely with WAHA (risky — no ban recovery)
- Coexist with automatic fallback (chosen — business reliability + unrestricted personal)
- Use WhatsApp Cloud API direct instead of Twilio (same restrictions, just cheaper)
- Abandon WhatsApp, use Telegram instead (different user base)
💭 Reasoning
The 24h session window restriction is a Meta platform rule that applies to ALL official WhatsApp Business API providers (Twilio, Cloud API, etc.). WAHA bypasses this by connecting as a regular WhatsApp user via the multi-device WebSocket protocol. However, WAHA carries ban risk (Meta actively banning automated accounts in 2025-2026). Business-critical messages (billing, transactional) must stay on Twilio for reliability and compliance. Personal channel is for contextual conversations, follow-ups, and invitations that fail via business channel. Architecture: WahaChannelService in messaging-core (same DI pattern as TwilioService), new case in ChannelGatewayService.sendResponse(), webhook controller for inbound. Conversations from each channel appear as separate threads in the UI (matching the user's phone experience where they see two WhatsApp conversations). Vitto's Brain/Memory provides unified context across both channels. WAHA_ENABLED=true/false acts as kill switch. Paused until physical SIM card is acquired.
📁 Files Involved
docs/superpowers/specs/2026-03-20-vitto-personal-whatsapp-channel-design.mdlibs/libs-api/messaging-core/src/lib/interfaces/messaging.interfaces.tsAPIs/backend-vitto-api/src/app/connectivity/channel-gateway.service.ts
🔗 Related
- Decision ID:
dev_1774113228901_2zzmfdj - Session: 250
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation