← Back to PRs

#13641: feat(whatsapp): surface incoming reaction events to agent

by asklee-klawd open 2026-02-10 20:00 View on GitHub →
channel: whatsapp-web stale
## Summary Adds support for receiving WhatsApp reaction events and surfacing them as system messages to the agent session. ## Changes - Add `WebInboundReaction` type in `src/web/inbound/types.ts` - Add `messages.reaction` event handler in `src/web/inbound/monitor.ts` - Wire up reaction events to system messages in `src/web/auto-reply/monitor.ts` ## How it works When a user reacts to a message, the agent sees a system event like: ``` System: [Reaction] 👍 from +1234567890 on message ABC123... ``` Or for removed reactions: ``` System: [Reaction removed] from +1234567890 on message ABC123... ``` ## Use cases - Agents can acknowledge user reactions ("Thanks for the thumbs up!") - Reactions can serve as lightweight feedback signals - Enables more natural conversational flows ## Testing - Build passes ✅ - Manually tested with WhatsApp sandbox Closes #11460 <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> Adds WhatsApp reaction event handling, surfacing reactions as system messages to the agent. The implementation follows a similar pattern to Telegram's reaction handling but has a routing issue that needs correction. **Key changes:** - New `WebInboundReaction` type with reactor info, emoji, target message ID, and action (add/remove) - Event listener for `messages.reaction` with proper cleanup in close handler - System event formatting: `[Reaction] 👍 from +1234567890 on message ABC123...` **Issue found:** - Reaction events currently route to the main session instead of the specific conversation session where the reaction occurred. The Telegram implementation shows the correct pattern (including peer info in route resolution). <h3>Confidence Score: 3/5</h3> - Safe to merge with one routing fix needed - The implementation is well-structured and follows existing patterns. One critical routing bug prevents reactions from appearing in the correct conversation context. Error handling and cleanup are properly implemented. The fix is straightforward. - Pay attention to `src/web/auto-reply/monitor.ts` - the routing logic needs correction to include peer context <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs