Skip to content

WhatsApp integration plugin#1335

Open
linuztx wants to merge 40 commits intoagent0ai:developmentfrom
linuztx:whatsapp-integration-plugin
Open

WhatsApp integration plugin#1335
linuztx wants to merge 40 commits intoagent0ai:developmentfrom
linuztx:whatsapp-integration-plugin

Conversation

@linuztx
Copy link
Copy Markdown
Contributor

@linuztx linuztx commented Mar 26, 2026

  • Add WhatsApp integration plugin using Baileys Node.js bridge with QR code pairing via web UI
  • Support dedicated number and self-chat modes with auto-restart on config change
  • Add group chat support — respond only when mentioned or replied to with allow_group toggle
  • Reply to specific messages in group chats with quote using message store
  • Download and handle all media types (images, documents, videos, audio) with RFC-based attachment reader/writer
  • Resolve group names and sender LIDs to human-readable format in prompts
  • Persistent typing indicator with poll-based refresh and cleanup on agent error
  • Convert markdown to WhatsApp formatting before sending replies
  • Add self-chat prefix for visual distinction of agent messages
  • Add disconnect account option to switch WhatsApp accounts
  • Kill orphaned bridge processes on port before starting new one
  • Handle Baileys documentWithCaptionMessage wrapper for captioned documents

linuztx added 30 commits March 26, 2026 00:29
linuztx and others added 10 commits March 27, 2026 21:58
The JS bridge used LIDs (internal WhatsApp identifiers) for sender
matching which never matched actual phone numbers. Moved filtering
to Python handler.py where config is read fresh each poll cycle.

- Add senderNumber (resolved phone) to bridge message payload
- Filter in poll_messages() with normalized number comparison
- Remove --allowed-numbers CLI arg and JS-side filtering
- Fix ensure_bridge_http_up not recording _bridge_config
- Fix falsy empty-dict check in bridge restart detection
…eated bridge failures

_ensure_npm_install now verifies key package exists, not just
node_modules dir. Wipes and reinstalls if corrupt.

Poll loop stops after 5 consecutive bridge start failures instead
of spamming errors and making A0 unusable.
…ency handling

- Add storage_paths.py helper for consistent session/media/runtime paths
- Replace hardcoded usr/whatsapp paths across all modules
- Fix bridge lock to be event-loop-aware (recreate per loop)
- Add automatic dependency reinstall on startup failures
- Track bridge startup output for better error diagnostics
- Add dependency state tracking with package.json hash validation
- Implement force reinstall when node_modules appears
… UI settings

- Change default mode to self-chat across all modules
- Update README to reflect self-chat as primary mode with security warning
- Move session/media storage from usr/whatsapp to tmp/whatsapp
- Reorder config UI: move Mode above Allowed Numbers
- Add warning banner when allowed_numbers is empty in self-chat mode
- Move Bridge Port and Poll Interval to bottom of settings
- Update mode descriptions to clarify self-chat handles both self
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants