fix(whatsapp-gateway): self-chat E2EE, agent UUID resolution, auto-connect#454
Open
Shuichi-code wants to merge 1 commit intoRightNow-AI:mainfrom
Open
fix(whatsapp-gateway): self-chat E2EE, agent UUID resolution, auto-connect#454Shuichi-code wants to merge 1 commit intoRightNow-AI:mainfrom
Shuichi-code wants to merge 1 commit intoRightNow-AI:mainfrom
Conversation
…nnect - Upgrade Baileys from v6 to v7.0.0-rc.9 for proper multi-device self-chat E2EE support (fixes "Waiting for this message" errors) - Add getMessage callback with in-memory message store for E2EE decryption of self-sent messages - Resolve agent name to UUID at startup via GET /api/agents, fixing "Invalid agent ID" errors when forwarding messages - Auto-connect to WhatsApp on startup if saved session (creds.json) exists, removing dependency on POST /login/start - Handle WhatsApp LID JIDs (@lid) by converting to @s.whatsapp.net for proper message delivery - Accept fromMe messages to support "Notes to Self" chat mode - Route self-sent message replies to account owner's JID - Quote original message in replies for E2EE context - Add file-based logging (gateway.log) since daemon captures stdout Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes multiple issues preventing the WhatsApp Web gateway from properly receiving and replying to messages through OpenFang:
getMessagecallback with in-memory message store — Required by Baileys v7 for E2EE decryption of self-sent messages on linked devices.GET /api/agentsto map human-readable agent names (e.g. "assistant") to UUIDs, fixing "Invalid agent ID" errors from the OpenFang API.auth_store/creds.jsonexists from a previous session, automatically reconnects to WhatsApp without requiringPOST /login/start. Essential since the OpenFang daemon spawns the gateway as a child process.@lidJIDs to@s.whatsapp.netfor proper message delivery.fromMemessages and routes replies to the account owner's JID instead of the LID.gateway.logsince the OpenFang daemon captures stdout, making debugging difficult.Test plan
auth_store/creds.jsonexists/api/agentsendpointgateway.logis written with timestamped entries