Bugfix: Why does the WhatsApp channel setup show a sandbox step when...

Documentation for Sessions

🐛 Bugfix: Why does the WhatsApp channel setup show a sandbox step when...

Date: 2026-02-21
Time: 17:37:55 UTC
Session: gspace1-131.9
Agent: angular
Confidence: 99%
Status: ✅ Documented


📋 Decision Context

Question:

Why does the WhatsApp channel setup show a sandbox step when TWILIO_WHATSAPP_MODE=production?

Task: Not specified


🎯 Decision Made

Chosen:

Only return sandboxInfo when isSandboxMode() is true

Options Considered:

  1. Remove sandbox code entirely
  2. Only return sandboxInfo when isSandboxMode() is true
  3. Add a mode check in the frontend

💭 Reasoning

Bug: ChannelService.setupWhatsApp() called twilio.getSandboxInfo() unconditionally, which returns non-null whenever TWILIO_SANDBOX_NUMBER and TWILIO_SANDBOX_CODE env vars are set -- regardless of TWILIO_WHATSAPP_MODE. The frontend then checks if sandboxInfo is truthy and shows the sandbox wizard step. Fix: Only call getSandboxInfo() when isSandboxMode() returns true. In production mode, set sandboxVerified=true, status='active', and return sandboxInfo=null so the frontend skips straight to the test step. This is a data-flow bug, not a UI bug.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation