From 631998287a212143226d0ec35ec558c3f68aca99 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Wed, 11 Mar 2026 19:50:12 -0400 Subject: [PATCH] Reply: share inbound dedupe state --- src/auto-reply/reply/inbound-dedupe.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/auto-reply/reply/inbound-dedupe.ts b/src/auto-reply/reply/inbound-dedupe.ts index 0e4740261b9..f8560c70609 100644 --- a/src/auto-reply/reply/inbound-dedupe.ts +++ b/src/auto-reply/reply/inbound-dedupe.ts @@ -6,10 +6,17 @@ import type { MsgContext } from "../templating.js"; const DEFAULT_INBOUND_DEDUPE_TTL_MS = 20 * 60_000; const DEFAULT_INBOUND_DEDUPE_MAX = 5000; -const inboundDedupeCache = createDedupeCache({ +/** + * Keep inbound dedupe shared across bundled chunks so the same provider + * message cannot bypass dedupe by entering through a different chunk copy. + */ +const _g = globalThis as typeof globalThis & { + __openclaw_inbound_dedupe_cache__?: DedupeCache; +}; +const inboundDedupeCache = (_g.__openclaw_inbound_dedupe_cache__ ??= createDedupeCache({ ttlMs: DEFAULT_INBOUND_DEDUPE_TTL_MS, maxSize: DEFAULT_INBOUND_DEDUPE_MAX, -}); +})); const normalizeProvider = (value?: string | null) => value?.trim().toLowerCase() || "";