Commit Graph

315 Commits

Author SHA1 Message Date
Peter Steinberger
38604acd94 fix: tighten WhatsApp ack reactions and migrate config (#629) (thanks @pasogott) 2026-01-11 04:11:04 +01:00
sheeek
c928df7237 fix: remove any casts in backward compat code 2026-01-11 04:10:43 +01:00
sheeek
30b4c14296 style: fix biome linting in ack-reaction tests 2026-01-11 04:10:43 +01:00
sheeek
2daead27cf feat(whatsapp): redesign ack-reaction as whatsapp-specific feature
- 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
2026-01-11 04:10:43 +01:00
sheeek
d38b232724 chore: fix linting issues in ack-reaction feature
- 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)
2026-01-11 04:10:43 +01:00
sheeek
c3587d6cae fix(whatsapp): ack reaction logic for group activation 'always' mode
- 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
2026-01-11 04:10:43 +01:00
sheeek
b3b507c6ea feat(whatsapp): add ack reaction support after successful replies
- 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
2026-01-11 04:10:42 +01:00
Peter Steinberger
6444258ad3 fix: handle WhatsApp LID mentions (#692) (thanks @peschee) 2026-01-11 01:14:57 +01:00
Peter Siska
9cb1bfa1c1 fix(whatsapp): pass authDir to jidToE164 for LID mention detection
WhatsApp group mentions using the new Linked ID format (@lid) were not
being detected because jidToE164() was called without the authDir needed
to find the LID reverse mapping files.

Now isBotMentioned() and debugMention() accept an optional authDir
parameter, which is passed through from account.authDir.
2026-01-11 01:04:10 +01:00
Peter Steinberger
7c76561569 fix: dedupe inbound messages across providers 2026-01-11 00:12:25 +01:00
Peter Steinberger
686b3f884c fix: expose WhatsApp sender ids in group context 2026-01-10 21:09:08 +01:00
Peter Steinberger
7e6fa94720 fix: update WhatsApp history assertions (#640) (thanks @mcinteerj) 2026-01-10 20:41:30 +01:00
Jake
4933113252 fix(whatsapp): preserve group message IDs and normalize reaction participants 2026-01-10 20:36:32 +01:00
Peter Steinberger
b977ae19af chore: fix lint and typing 2026-01-10 19:16:25 +01:00
Peter Steinberger
d41372b9d9 feat: unify provider history context 2026-01-10 19:16:25 +01:00
Peter Steinberger
e3cd431551 fix(auto-reply): RawBody commands + locked session updates (#643) 2026-01-10 17:32:31 +01:00
Peter Steinberger
f28a4a34ad refactor: unify inline directives and media fetch 2026-01-10 03:01:04 +01:00
Peter Steinberger
4075895c4c refactor: consolidate reply/media helpers 2026-01-10 02:41:16 +01:00
Peter Steinberger
82ffcfb181 fix(web): show all WhatsApp shared contacts 2026-01-10 00:22:31 +00:00
Peter Steinberger
a9bd01b523 refactor: unify contact list summaries 2026-01-10 01:13:38 +01:00
Peter Steinberger
103dd3af64 fix: keep contact summary counts (#625) (thanks @mahmoudashraf93) 2026-01-10 01:02:28 +01:00
Mahmoud Ibrahim
d1e10af1e1 WhatsApp: show all contacts in shares 2026-01-10 01:00:00 +01:00
Mahmoud Ibrahim
18338bc60f Style: format contact label helper 2026-01-10 01:00:00 +01:00
Mahmoud Ibrahim
fd7450e5b9 WhatsApp: include numbers in contact cards 2026-01-10 01:00:00 +01:00
Peter Steinberger
695be8e92d Merge pull request #624 from clawdbot/refactor/vcard-utils
refactor: extract vcard parsing helper
2026-01-09 23:16:31 +00:00
Peter Steinberger
b6b1b570f9 refactor: extract vcard parsing helper 2026-01-10 00:12:53 +01:00
Peter Steinberger
6016a63162 refactor(web): centralize active web listener resolution 2026-01-09 23:12:29 +00:00
Peter Steinberger
1277f6e27b fix: prefer FN for WhatsApp contact cards (#622) (thanks @mahmoudashraf93) 2026-01-10 00:08:30 +01:00
Mahmoud Ibrahim
30b3d6ce61 WhatsApp: handle contact cards inbound 2026-01-10 00:07:04 +01:00
Peter Steinberger
88cbe2d275 fix: cap pairing requests and suppress outbound pairing replies 2026-01-09 22:58:18 +00:00
Peter Steinberger
a18743eabc fix(web): improve WhatsApp Web listener errors (#612, thanks @YuriNachos) 2026-01-09 22:40:58 +00:00
Yurii Chukhlib
a9f8719cd2 fix(web): remove provider name from gateway listener error messages
Error messages in sendMessageWhatsApp, sendReactionWhatsApp, and
sendPollWhatsApp included hardcoded \"WhatsApp\" references. This caused
confusion when cron jobs using other providers (e.g., Telegram) failed
with errors mentioning WhatsApp.

Changes error messages to be provider-agnostic while maintaining the
same error handling behavior.

Fixes #461
Fixes #470

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-09 22:40:58 +00:00
Peter Steinberger
6c7a27c010 refactor: normalize main session key handling 2026-01-09 22:30:15 +01:00
Peter Steinberger
42a0089b3b fix: require explicit system event session keys 2026-01-09 21:59:01 +01:00
Peter Steinberger
a5065b354e fix(whatsapp): resolve lid mappings for inbound 2026-01-09 21:46:18 +01:00
Peter Steinberger
1a97aadb6b fix: broadcast group history consistency (#547) 2026-01-09 21:39:58 +01:00
Peter Steinberger
7641b142ad refactor: harden broadcast groups 2026-01-09 21:39:58 +01:00
Peter Steinberger
76964162c7 fix: land broadcast groups (#547) (thanks @pasogott) 2026-01-09 21:14:19 +01:00
sheeek
09769d127f feat: add broadcast groups for multi-agent responses
Enables multiple agents to process the same message simultaneously,
allowing teams of specialized agents with atomic tasks to work together
in the same group using one phone number.

Key features:
- Configure multiple agents per WhatsApp group/DM via routing.broadcast
- Parallel (default) or sequential processing strategies
- Full session isolation (separate history, workspace, tools per agent)
- Minimal code changes (~50 lines in auto-reply.ts)
- Backward compatible with existing routing

Use cases:
- Specialized agent teams (code reviewer + security scanner + docs)
- Multi-language support (EN + DE + ES agents)
- Quality assurance workflows (support + QA agents)
- Task automation (tracker + logger + reporter)

Example config:
{
  "routing": {
    "broadcast": {
      "strategy": "parallel",
      "120363403215116621@g.us": ["alfred", "baerbel", "assistant3"]
    }
  }
}

This enables scaling to hundreds of focused micro-agents on a single
phone number, each handling specific atomic tasks.
2026-01-09 21:05:58 +01:00
Peter Steinberger
a65455e25d fix: align WhatsApp activity account id (#537) (thanks @Nachx639) 2026-01-09 20:42:35 +01:00
Tu Nombre Real
a05c4fca5c fix(web): pass accountId in WhatsApp provider activity tracking
Recent changes added recordProviderActivity calls with accountId, but
the type definition and usage didn't include accountId in ActiveWebSendOptions.
This fix adds the optional accountId field and uses optional chaining
when accessing it to handle cases where options is undefined.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 20:40:03 +01:00
Peter Steinberger
2977b296e6 feat(messages): add whatsapp messagePrefix and responsePrefix auto 2026-01-09 19:29:04 +00:00
Peter Steinberger
72b0777341 fix(messages): restore explicit responsePrefix default 2026-01-09 19:18:34 +00:00
Peter Steinberger
837cec64af refactor: centralize test path containment checks 2026-01-09 19:15:44 +00:00
Peter Steinberger
87f432880a fix: honor whatsapp mediaMaxMb (#505) (thanks @koala73) 2026-01-09 19:51:35 +01:00
Elie Habib
3026367c1b feat(whatsapp): add configurable media max size
- Add whatsapp.mediaMaxMb config option (default: 50MB)
- Increases default from previous 5MB hardcoded limit
- Allows receiving larger documents/media files
- Per-account override via whatsapp.accounts.*.mediaMaxMb

Fixes #<issue-number> (if applicable)
2026-01-09 19:40:21 +01:00
Jake
a05916bee8 Config: add support for per-provider blockStreaming override 2026-01-09 18:11:27 +00:00
Peter Steinberger
d6d84ce349 test: harden logout path check on windows 2026-01-09 18:39:38 +01:00
Peter Steinberger
dac3b675cc fix: stabilize CI path assumptions 2026-01-09 18:35:52 +01:00
Peter Steinberger
6aac3184c3 test: normalize windows path assertions 2026-01-09 18:32:45 +01:00