openclaw/src/config
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
..
sessions feat: add matrix channel plugin 2026-01-15 08:40:37 +00:00
agent-dirs.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
cache-utils.ts fix: persist topic session files 2026-01-07 22:56:50 +00:00
channel-capabilities.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
channel-capabilities.ts feat: load channel plugins 2026-01-15 02:42:44 +00:00
commands.ts feat: load channel plugins 2026-01-15 02:42:44 +00:00
config-paths.test.ts feat: improve gateway services and auto-reply commands 2026-01-11 02:27:16 +01:00
config-paths.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
config.broadcast.test.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
config.compaction-settings.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
config.discord.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
config.env-vars.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
config.identity-defaults.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
config.legacy-config-detection.accepts-imessage-dmpolicy.test.ts fix: normalize Claude CLI auth mode to oauth (#855) 2026-01-15 02:29:43 +00:00
config.legacy-config-detection.rejects-routing-allowfrom.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
config.msteams.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
config.multi-agent-agentdir-validation.test.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
config.nix-integration-u3-u5-u9.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
config.preservation-on-validation-failure.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
config.pruning-defaults.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
config.sandbox-docker.test.ts style: oxfmt fixes (#925) (thanks @grp06) 2026-01-15 03:22:54 +00:00
config.talk-api-key-fallback.test.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
config.talk-voicealiases.test.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
config.ts feat: extend Telegram dock commands and config hashing (#929) 2026-01-15 05:49:28 +00:00
defaults.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
group-policy.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
includes.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
includes.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
io.ts feat: extend Telegram dock commands and config hashing (#929) 2026-01-15 05:49:28 +00:00
legacy-migrate.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
legacy.migrations.part-1.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
legacy.migrations.part-2.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
legacy.migrations.part-3.ts fix: normalize Claude CLI auth mode to oauth (#855) 2026-01-15 02:29:43 +00:00
legacy.migrations.ts refactor(config): split legacy handling 2026-01-14 05:39:51 +00:00
legacy.rules.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
legacy.shared.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
legacy.ts refactor(config): split legacy handling 2026-01-14 05:39:51 +00:00
merge-config.ts refactor!: rename chat providers to channels 2026-01-13 08:40:39 +00:00
merge-patch.ts fix: prevent config clobbering 2026-01-15 04:06:11 +00:00
model-alias-defaults.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
normalize-paths.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
normalize-paths.ts fix: normalize ~ in path config 2026-01-12 01:53:42 +00:00
paths.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
paths.ts chore: drop Clawdis legacy references 2026-01-15 06:18:44 +00:00
port-defaults.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
runtime-overrides.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
runtime-overrides.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
schema.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
schema.ts feat(whatsapp): add debounceMs for batching rapid messages (#971) 2026-01-15 23:07:19 +00:00
sessions.cache.test.ts fix: harden session cache + heartbeat restore 2026-01-15 07:07:12 +00:00
sessions.test.ts chore: drop Clawdis legacy references 2026-01-15 06:18:44 +00:00
sessions.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
talk.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
test-helpers.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
types.agent-defaults.ts feat(date-time): standardize time context and tool timestamps 2026-01-15 22:27:06 +00:00
types.agents.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
types.auth.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
types.base.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
types.browser.ts fix(browser): default to chrome extension takeover 2026-01-15 09:02:42 +00:00
types.channels.ts feat: load channel plugins 2026-01-15 02:42:44 +00:00
types.clawdbot.ts fix: prevent config clobbering 2026-01-15 04:06:11 +00:00
types.cron.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
types.discord.ts feat(config): gate channel config writes 2026-01-15 01:41:15 +00:00
types.gateway.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
types.hooks.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
types.imessage.ts feat(config): gate channel config writes 2026-01-15 01:41:15 +00:00
types.messages.ts feat(whatsapp): add debounceMs for batching rapid messages (#971) 2026-01-15 23:07:19 +00:00
types.models.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
types.msteams.ts feat(config): gate channel config writes 2026-01-15 01:41:15 +00:00
types.plugins.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
types.queue.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
types.sandbox.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
types.signal.ts feat(config): gate channel config writes 2026-01-15 01:41:15 +00:00
types.skills.ts refactor(src): split oversized modules 2026-01-14 01:17:56 +00:00
types.slack.ts fix: isolate Slack thread sessions (#758) 2026-01-15 08:11:03 +00:00
types.telegram.ts fix: refine telegram reactions (#964) (thanks @bohdanpodvirnyi) 2026-01-15 17:20:17 +00:00
types.tools.ts fix: stabilize gateway config tests + tool schema 2026-01-15 05:16:28 +00:00
types.ts fix: remove dup definitions + add reaction config 2026-01-15 17:07:38 +00:00
types.whatsapp.ts feat(whatsapp): add debounceMs for batching rapid messages (#971) 2026-01-15 23:07:19 +00:00
ui-seam-color.test.ts feat: add ui.seamColor accent 2025-12-30 04:14:36 +01:00
validation.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
zod-schema.agent-defaults.ts feat(date-time): standardize time context and tool timestamps 2026-01-15 22:27:06 +00:00
zod-schema.agent-runtime.ts fix: stabilize gateway config tests + tool schema 2026-01-15 05:16:28 +00:00
zod-schema.agents.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
zod-schema.core.ts feat(whatsapp): add debounceMs for batching rapid messages (#971) 2026-01-15 23:07:19 +00:00
zod-schema.hooks.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
zod-schema.providers-core.ts fix: refine telegram reactions (#964) (thanks @bohdanpodvirnyi) 2026-01-15 17:20:17 +00:00
zod-schema.providers-whatsapp.ts feat(whatsapp): add debounceMs for batching rapid messages (#971) 2026-01-15 23:07:19 +00:00
zod-schema.providers.ts feat: load channel plugins 2026-01-15 02:42:44 +00:00
zod-schema.session.ts feat(whatsapp): add debounceMs for batching rapid messages (#971) 2026-01-15 23:07:19 +00:00
zod-schema.ts fix: remove dup definitions + add reaction config 2026-01-15 17:07:38 +00:00