#13641: feat(whatsapp): surface incoming reaction events to agent
channel: whatsapp-web
stale
Cluster:
Reaction Event Handling Enhancements
## 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
#20399: feat(whatsapp): surface inbound reaction events to agent session
by andrewchen · 2026-02-18
92.1%
#12894: feat(whatsapp): add reaction notifications support
by ekson73 · 2026-02-09
87.8%
#16716: feat(feishu): add reaction event support (created/deleted)
by schumilin · 2026-02-15
77.6%
#22919: WhatsApp: add lifecycle status reactions
by tristanmanchester · 2026-02-21
77.1%
#20860: feat(reactions): add configurable immediate reaction dispatch system
by davidrudduck · 2026-02-19
76.1%
#19757: fix(security): OC-91 enforce JID allowlist validation in WhatsApp s...
by aether-ai-agent · 2026-02-18
72.9%
#7980: feat(telegram): multi-stage reaction system for message pipeline vi...
by macmimi23 · 2026-02-03
72.6%
#7545: feat(hooks): add message:received hook for pre-turn automation
by wangtian24 · 2026-02-02
72.3%
#21346: [AI-assisted] Telegram: add reaction state machine with fallback an...
by Archie818 · 2026-02-19
72.2%
#19816: feat(slack): add typingReaction config for DM typing indicator fall...
by dalefrieswthat · 2026-02-18
72.0%