惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
WordPress大学
WordPress大学
月光博客
月光博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 聂微东
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
雷峰网
雷峰网
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
美团技术团队
宝玉的分享
宝玉的分享
Hugging Face - Blog
Hugging Face - Blog
阮一峰的网络日志
阮一峰的网络日志
A
About on SuperTechFans
Jina AI
Jina AI
D
Docker
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | Blog
Stack Overflow Blog
Stack Overflow Blog
Microsoft Azure Blog
Microsoft Azure Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(whatsapp): clarify inbound group diagnostics (#83969)...
clawsweeper · 2026-05-19 · via Recent Commits to openclaw:main

@@ -6,6 +6,7 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest";

66

import type { WhatsAppSendResult } from "../inbound/send-result.js";

77

import { buildMentionConfig } from "./mentions.js";

88

import { applyGroupGating, type GroupHistoryEntry } from "./monitor/group-gating.js";

9+

import { formatWhatsAppInboundListeningLog } from "./monitor/listener-log.js";

910

import { buildInboundLine, formatReplyContext } from "./monitor/message-line.js";

1011

import type { WebInboundMsg } from "./types.js";

1112

@@ -59,6 +60,7 @@ async function runGroupGating(params: {

5960

const agentId = params.agentId ?? "main";

6061

const sessionKey = `agent:${agentId}:whatsapp:group:${conversationId}`;

6162

const baseMentionConfig = buildMentionConfig(params.cfg, undefined);

63+

const verboseLogs: string[] = [];

6264

const result = await applyGroupGating({

6365

cfg: params.cfg,

6466

msg: params.msg,

@@ -72,10 +74,10 @@ async function runGroupGating(params: {

7274

groupHistories,

7375

groupHistoryLimit: 10,

7476

groupMemberNames: new Map(),

75-

logVerbose: () => {},

77+

logVerbose: (message) => verboseLogs.push(message),

7678

replyLogger: { debug: () => {} },

7779

});

78-

return { result, groupHistories };

80+

return { result, groupHistories, verboseLogs };

7981

}

80828183

function createGroupMessage(overrides: Partial<WebInboundMsg> = {}): WebInboundMsg {

@@ -116,6 +118,55 @@ function makeInboundCfg(messagePrefix = "") {

116118

} as never;

117119

}

118120121+

describe("WhatsApp listener diagnostics", () => {

122+

it("describes WhatsApp inbound listener scope without implying DM-only routing", () => {

123+

expect(

124+

formatWhatsAppInboundListeningLog({

125+

groupPolicy: "open",

126+

hasGroupAllowFrom: false,

127+

}),

128+

).toBe(

129+

"Listening for WhatsApp inbound messages (DM + all groups; no group allowlist configured).",

130+

);

131+

expect(

132+

formatWhatsAppInboundListeningLog({

133+

groupPolicy: "disabled",

134+

hasGroupAllowFrom: true,

135+

}),

136+

).toBe("Listening for WhatsApp inbound messages (DM + groups disabled by groupPolicy).");

137+

expect(

138+

formatWhatsAppInboundListeningLog({

139+

groupPolicy: "allowlist",

140+

hasGroupAllowFrom: false,

141+

}),

142+

).toBe(

143+

"Listening for WhatsApp inbound messages (DM + group inbound blocked by empty groupPolicy allowlist).",

144+

);

145+

expect(

146+

formatWhatsAppInboundListeningLog({

147+

groupPolicy: "allowlist",

148+

hasGroupAllowFrom: true,

149+

}),

150+

).toBe(

151+

"Listening for WhatsApp inbound messages (DM + all groups; sender allowlist configured).",

152+

);

153+

expect(

154+

formatWhatsAppInboundListeningLog({

155+

groups: { "123@g.us": {}, "*": {} },

156+

groupPolicy: "allowlist",

157+

hasGroupAllowFrom: true,

158+

}),

159+

).toBe("Listening for WhatsApp inbound messages (DM + all groups; wildcard configured).");

160+

expect(

161+

formatWhatsAppInboundListeningLog({

162+

groups: { "123@g.us": {}, "456@g.us": {} },

163+

groupPolicy: "allowlist",

164+

hasGroupAllowFrom: true,

165+

}),

166+

).toBe("Listening for WhatsApp inbound messages (DM + 2 configured groups).");

167+

});

168+

});

169+119170

describe("applyGroupGating", () => {

120171

it("treats reply-to-bot as implicit mention", async () => {

121172

const cfg = makeConfig({});

@@ -583,7 +634,7 @@ describe("applyGroupGating", () => {

583634

},

584635

});

585636586-

const { result } = await runGroupGating({

637+

const { result, verboseLogs } = await runGroupGating({

587638

cfg,

588639

msg: createGroupMessage({

589640

body: "@workbot ping",

@@ -593,6 +644,9 @@ describe("applyGroupGating", () => {

593644

});

594645595646

expect(result.shouldProcess).toBe(false);

647+

expect(verboseLogs).toContain(

648+

'Dropping message from unregistered WhatsApp group 123@g.us. Add the group JID to channels.whatsapp.groups, or add "*" there to admit all groups. Sender authorization still applies.',

649+

);

596650

});

597651

});

598652