Skip to content

feat(whatsapp): add acknowledgment reactions#629

Merged
steipete merged 7 commits intoopenclaw:mainfrom
pasogott:feature/whatsapp-ack-reaction
Jan 11, 2026
Merged

feat(whatsapp): add acknowledgment reactions#629
steipete merged 7 commits intoopenclaw:mainfrom
pasogott:feature/whatsapp-ack-reaction

Conversation

@pasogott
Copy link
Copy Markdown
Contributor

@pasogott pasogott commented Jan 9, 2026

feat(whatsapp): add acknowledgment reactions

Overview

Implements automatic emoji reactions for WhatsApp messages, sent immediately upon receipt to provide instant user feedback. This is a WhatsApp-specific feature with granular per-chat-type control.

Changes

  • Config: New whatsapp.ackReaction structure with {emoji, direct, group} options
  • Logic: Reactions sent at start of processMessage(), before typing indicator
  • Schema: Zod validation for new config structure
  • Tests: 14 new unit tests covering all scenarios
  • Docs: Comprehensive documentation in docs/providers/whatsapp.md
  • Backward Compatibility: Old messages.ackReaction format still supported via fallback

Configuration

whatsapp:
  ackReaction:
    emoji: "👀"           # Emoji to use (empty = disabled)
    direct: true          # React in direct chats (default: true)
    group: "mentions"     # Group mode: "always" | "mentions" | "never" (default: "mentions")

Per-account override:

whatsapp:
  accounts:
    work:
      ackReaction:
        emoji: ""
        direct: false
        group: "always"

Behavior

  • Timing: Reaction sent immediately upon message receipt (before bot reply)
  • Direct chats: Controlled by direct boolean
  • Group chats: Three modes:
    • "always": React to all messages
    • "mentions": Only when bot is @mentioned (respects requireMention: false)
    • "never": Never react in groups
  • Error handling: Fire-and-forget with logging (reactions are non-critical)
  • Participant support: Automatically includes sender JID for group reactions

Testing

Extensively tested with 5 scenarios:

  1. direct=false, group="mentions" - No direct, groups with mention only
  2. direct=true, group="always" - All direct, all groups
  3. direct=true, group="never" - All direct, no groups
  4. direct=false, group="always" - No direct, all groups
  5. ✅ Multiple emojis tested (👀, ✅)

Unit tests: 14/14 passing
Build: Success, 0 linting errors
Live tested: Direct chats and group chats with various configurations

Files Changed

 docs/providers/whatsapp.md                  | +66 lines (new section + config map)
 src/config/types.ts                         | +18 lines (TypeDoc comments)
 src/config/zod-schema.ts                    | +32 lines (validation)
 src/web/auto-reply.ts                       | +56 lines (implementation)
 src/web/auto-reply.ack-reaction.test.ts     | 260 lines (complete rewrite)

Total: ~433 lines changed (5 files)

Breaking Changes

⚠️ Config location changed:

  • Old: messages.ackReaction + messages.ackReactionScope
  • New: whatsapp.ackReaction.{emoji, direct, group}

Migration is automatic via fallback, but users should update their configs:

Old format (still works):

messages:
  ackReaction: "👀"
  ackReactionScope: "all"  # or "direct", "group-all", "group-mentions"

New format (recommended):

whatsapp:
  ackReaction:
    emoji: "👀"
    direct: true
    group: "mentions"

Related

Checklist

  • Implementation complete
  • Tests written and passing (14/14)
  • Documentation updated
  • Backward compatibility maintained
  • Build succeeds
  • Linting passes (0 errors, 0 warnings)
  • Live tested with multiple scenarios
  • TypeDoc comments added
  • Zod schema updated

Screenshots / Demo

Live tested with:

  • ✅ Direct messages show immediate 👀 reaction
  • ✅ Group messages with @mention show reaction
  • ✅ Group messages without @mention (with requireMention: false) show reaction
  • ✅ Different emojis work (👀, ✅, 🤖, etc.)
  • ✅ Timing: reaction appears before bot starts typing

sheeek and others added 7 commits January 11, 2026 04:10
- Add automatic emoji reactions on inbound WhatsApp messages
- Support all ackReactionScope modes: all, direct, group-all, group-mentions
- Reaction is sent AFTER successful reply (unlike Telegram/Discord)
- Errors are logged with proper context
- Add comprehensive test suite for ack reaction logic

Config usage:
  messages:
    ackReaction: "👀"
    ackReactionScope: "group-mentions"  # default

Closes: WhatsApp ack-reaction feature request
- Fix bug where ack reaction was not sent when group activation is 'always'
- When requireMention=false (activation: always), always send reaction
- Add test case for activation='always' scenario
- Update inline comments for clarity
- Remove unused mock variables in tests
- Remove unused ackReactionScope variables in simple test cases
- Fix line length for ackReactionScope declaration
- All lint checks passing (0 warnings, 0 errors)
- All tests passing (8/8)
- Move config from messages.ackReaction to whatsapp.ackReaction
- New structure: {emoji, direct, group} with granular control
- Support per-account overrides in whatsapp.accounts.*.ackReaction
- Add Zod schema validation for new config
- Maintain backward compatibility with old messages.ackReaction format
- Update tests to new config structure (14 tests, all passing)
- Add comprehensive documentation in docs/providers/whatsapp.md
- Timing: reactions sent immediately upon message receipt (before bot reply)

Breaking changes:
- Config moved from messages.ackReaction to whatsapp.ackReaction
- Scope values changed: 'all'/'direct'/'group-all'/'group-mentions'
  → direct: boolean + group: 'always'/'mentions'/'never'
- Old config still supported via fallback for smooth migration
@steipete steipete force-pushed the feature/whatsapp-ack-reaction branch from 7aa734f to 38604ac Compare January 11, 2026 03:11
@steipete steipete merged commit bfd0dcd into openclaw:main Jan 11, 2026
6 of 20 checks passed
@steipete
Copy link
Copy Markdown
Contributor

Landed via temp rebase onto main.\n\n- Gate: pnpm lint && pnpm build && pnpm test\n- Land commit: 38604ac\n- Merge commit: bfd0dcd\n\nThanks @pasogott!

zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…action

feat(whatsapp): add acknowledgment reactions
heatherstew44-maker pushed a commit to heatherstew44-maker/openclaw that referenced this pull request Mar 8, 2026
* arm build?

* try newer vulkan

* dont think this will work but try anyway

* Update build.yml
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
lovewanwan pushed a commit to lovewanwan/openclaw that referenced this pull request Apr 28, 2026
…action

feat(whatsapp): add acknowledgment reactions
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…action

feat(whatsapp): add acknowledgment reactions
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.

feat: WhatsApp acknowledgment reactions

2 participants