openclaw/src/msteams
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
..
attachments chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
monitor-handler feat(whatsapp): add debounceMs for batching rapid messages (#971) 2026-01-15 23:07:19 +00:00
attachments.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
attachments.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
conversation-store-fs.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
conversation-store-fs.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
conversation-store-memory.ts MS Teams: refactor provider + replyStyle + reliability 2026-01-09 11:06:38 +01:00
conversation-store.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
errors.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
errors.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
inbound.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
inbound.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
index.ts feat: finalize msteams polls + outbound parity 2026-01-09 11:07:32 +01:00
messenger.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
messenger.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
monitor-handler.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
monitor-types.ts refactor(msteams): extract sdk + storage helpers 2026-01-09 11:07:32 +01:00
monitor.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
policy.test.ts fix: harden msteams group access 2026-01-12 08:32:08 +00:00
policy.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
polls-store-memory.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
polls-store.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
polls.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
polls.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
probe.test.ts MS Teams: refactor provider + replyStyle + reliability 2026-01-09 11:06:38 +01:00
probe.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
reply-dispatcher.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
sdk-types.ts MS Teams: refactor provider + replyStyle + reliability 2026-01-09 11:06:38 +01:00
sdk.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
send-context.ts refactor!: rename chat providers to channels 2026-01-13 08:40:39 +00:00
send.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
storage.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
store-fs.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
token.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00