Skip to content

Integrate WhatsApp connectivity through the wacli CLI, paired as a Wh… - #73

Open
arefbehboudi wants to merge 5 commits into
mainfrom
whatsapp-integration
Open

Integrate WhatsApp connectivity through the wacli CLI, paired as a Wh…#73
arefbehboudi wants to merge 5 commits into
mainfrom
whatsapp-integration

Conversation

@arefbehboudi

@arefbehboudi arefbehboudi commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

…atsApp Web linked device. JavaClaw supervises wacli sync as a subprocess and receives inbound messages over a local webhook, replying with wacli send.

WacliSyncSupervisor: launches and restarts the sync subprocess with exponential backoff and health-based retry reset. WhatsAppWebhookController: handles inbound webhooks, gates on the allowed chat JID, and processes messages off the request thread. WacliWhatsAppChannel: sends replies and suppresses echoes of the agent's own outbound messages by message ID. WhatsAppOnboardingProvider: onboarding step for install/pair/config. Wire the plugin into the build and document setup in the README.

Closes #52

arefbehboudi and others added 5 commits July 18, 2026 19:38
…atsApp Web linked device. JavaClaw supervises wacli sync as a subprocess and receives inbound messages over a local webhook, replying with wacli send.

WacliSyncSupervisor: launches and restarts the sync subprocess with exponential backoff and health-based retry reset.
WhatsAppWebhookController: handles inbound webhooks, gates on the allowed chat JID, and processes messages off the request thread.
WacliWhatsAppChannel: sends replies and suppresses echoes of the agent's own outbound messages by message ID.
WhatsAppOnboardingProvider: onboarding step for install/pair/config.
Wire the plugin into the build and document setup in the README.
Fold the wacli command line into WhatsApp so it is the only class that
knows wacli exists. Everything else talks to it:

  WhatsApp                    the chat we talk in: send, receive, list
  WacliSync                   keeps the 'wacli sync' subprocess alive
  WhatsAppChannel             puts the agent behind it
  WhatsAppWebhookController   answers wacli, hands over the message

WacliSync no longer knows what wacli is: it takes a ProcessStarter, a
Clock and a restart delay, which also lets its tests drive the restarts
without really waiting.

Refuse group chats. The assistant authorises by chat, so pointing it at a
group let every member instruct an agent that can run shell commands.
Onboarding now accepts one-to-one JIDs only, and the SenderJID field that
nothing ever read is gone rather than left looking like a check.

Pick the chat by name during onboarding, from 'wacli chats list'. WhatsApp
issues opaque @lid identifiers that cannot be derived from a phone number,
so asking people to type a JID did not work for many chats.

Drop the wacli-path property and take wacli from the PATH; the onboarding
page claimed to store it and never did.

Move the Brave step to @order(56) so WhatsApp keeps 55.
Spring Modulith only treats types in a module's root package as its API,
so ai.javaclaw.utils.threads.NamedThreadFactory was internal to the utils
module and the WhatsApp webhook controller could not use it. Move it up to
ai.javaclaw.utils, alongside how ai.javaclaw.cli.CliRunner is already
reachable from plugins.

Fixes ModularityTests, which arrived on main after this branch started.
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.

Feature Request: Add Whatsapp channel integration using wacli

2 participants