{"wiki":{"id":144,"slug":"message-handler","entity_type":"droid","entity_id":"message-handler","title":"Message Handler — Inbound Processing Engine","prose_md":"## About\n\nMessage Handler is Carol's inbox. It receives every incoming WhatsApp message — text, voice notes, images, videos, documents — and routes them through the right processing path. It also powers Carol's web chat for Google OAuth users.\n\n## Capabilities\n\n- **Text messages** — extracts text and routes through the LLM reply pipeline\n- **Voice notes** — transcribes via speech-to-text, then replies by voice or text\n- **Images** — downloads and enables Read-tool access so Carol can \"see\" them\n- **Videos** — downloads and processes for context\n- **Documents** — extracts text content for Carol to reference\n- **Reflex quick-replies** — sends instant acknowledgments (\"On it, let me check…\") before full processing\n- **Web chat** — serves as the backend for the web-chat endpoint at `/api/web/chat`\n\n## Processing flow\n\n```\nInbound message → message-handler\n  ├─ Media? → download/transcribe\n  ├─ Reflex quick-reply → \"On it\" (instant, <3s)\n  └─ Full processing → agent_loop → PA-C0 → QG-01 → send_whatsapp\n```\n\n## Owner\n\nCarol (agt_008) — Sales agent, Carolverse OS's WhatsApp and web presence.","namesake_json":"{}","profile_pic_path":"/static/avatars/droid/message-handler.png","source_hash":"","status":"active","last_generated_at":null,"created_at":"2026-07-07 18:20:14","updated_at":"2026-07-07 18:24:07"},"facts":{"id":"message-handler","name":"Carol Message Handler","machine_name":"","owner":"agt_008","function":"Processes incoming WhatsApp and web messages through Carol's response pipeline. Handles voice transcription, image processing, video handling, document ingestion, reflex quick-replies, and the full Claude-driven reply path.","process_type":"daemon","schedule":"","process_name":"","avatar_color":"#94a3b8","created_for":"Carol's message processing was originally a monolith. message-handler was extracted as a modular droid to own inbound message handling, separate from the reply drafter (PA-C0), service router (PA-C12), and quality guard (QG-01). The web-chat endpoint also routes through it.","purpose":"message-handler is the bridge between raw inbound messages and Carol's response. It decodes media attachments, manages typing indicators, runs the reflex quick-response path for instant acknowledgments, and orchestrates the full LLM-driven reply path for substantive responses. It also powers the web-chat endpoint for Google OAuth authenticated users.","duties":"- Receive and decode WhatsApp messages (text, voice, image, video, document)\n- Transcribe voice messages via speech-to-text\n- Send typing indicators for human-like pacing\n- Run reflex quick-reply for instant acknowledgments before full processing\n- Orchestrate the full LLM-driven reply path for substantive messages\n- Handle web-chat messages from Google OAuth users via the internal relay","constraints":"- Must handle all WhatsApp message types (text, voice, image, video, document)\n- Voice processing depends on Gemini/OpenAI TTS availability\n- Reflex replies must complete in <3s for acceptable user experience\n- Full processing can take up to 120s with tool calls","status":"running","gender":"","archetype":"","building_block":"conversation","service_override":null,"enabled":1,"task_key":"sales.conversation_served","model_free":0},"page":{"type":"droid","page_class":"main","class_label":"Main page","kind_label":"Droid","kind_gloss":"","listed":true}}