openclaw/src/slack
juanpablodlc 4a99b9b651
feat(whatsapp): add debounceMs for batching rapid messages (#971)
* feat(whatsapp): add debounceMs for batching rapid messages

Add a `debounceMs` configuration option to WhatsApp channel settings
that batches rapid consecutive messages from the same sender into a
single response. This prevents triggering separate agent runs for
each message when a user sends multiple short messages in quick
succession (e.g., "Hey!", "how are you?", "I was wondering...").

Changes:
- Add `debounceMs` config to WhatsAppConfig and WhatsAppAccountConfig
- Implement message buffering in `monitorWebInbox` with:
  - Map-based buffer keyed by sender (DM) or chat ID (groups)
  - Debounce timer that resets on each new message
  - Message combination with newline separator
  - Single message optimization (no modification if only one message)
- Wire `debounceMs` through account resolution and monitor tuning
- Add UI hints and schema documentation

Usage example:
{
  "channels": {
    "whatsapp": {
      "debounceMs": 5000  // 5 second window
    }
  }
}

Default behavior: `debounceMs: 0` (disabled by default)

Verified: All existing tests pass (3204 tests), TypeScript compilation
succeeds with no errors.

Implemented with assistance from AI coding tools.

Closes #967

* chore: wip inbound debounce

* fix: debounce inbound messages across channels (#971) (thanks @juanpablodlc)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-01-15 23:07:19 +00:00
..
monitor feat(whatsapp): add debounceMs for batching rapid messages (#971) 2026-01-15 23:07:19 +00:00
accounts.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
actions.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
channel-migration.test.ts feat(config): gate channel config writes 2026-01-15 01:41:15 +00:00
channel-migration.ts feat(config): gate channel config writes 2026-01-15 01:41:15 +00:00
format.test.ts refactor: unify markdown formatting pipeline 2026-01-15 00:31:07 +00:00
format.ts fix: preserve markdown code fences 2026-01-15 00:31:07 +00:00
index.ts feat: add slack multi-account routing 2026-01-08 08:49:16 +01:00
monitor.test.ts Slack: accept slash command names with or without leading slash 2026-01-12 21:27:04 -06:00
monitor.tool-result.forces-thread-replies-replytoid-is-set.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
monitor.tool-result.sends-tool-summaries-responseprefix.test.ts fix: isolate Slack thread sessions (#758) 2026-01-15 08:11:03 +00:00
monitor.tool-result.threads-top-level-replies-replytomode-is-all.test.ts fix: isolate Slack thread sessions (#758) 2026-01-15 08:11:03 +00:00
monitor.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
probe.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
send.ts refactor: unify markdown formatting pipeline 2026-01-15 00:31:07 +00:00
threading.test.ts refactor: centralize slack threading helpers 2026-01-09 16:01:53 +00:00
threading.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
token.ts Slack: add some fixes and connect it all up 2026-01-04 01:53:26 -06:00
types.ts refactor: centralize slack threading helpers 2026-01-09 16:01:53 +00:00