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

推荐订阅源

人人都是产品经理
人人都是产品经理
博客园_首页
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Vercel News
Vercel News
美团技术团队
D
Docker
WordPress大学
WordPress大学
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
Y
Y Combinator Blog
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
S
SegmentFault 最新的问题
GbyAI
GbyAI
Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans

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): honor group visible reply mode (#76973) · ...
scoootscooob · 2026-05-04 · via Recent Commits to openclaw:main

@@ -36,6 +36,28 @@ vi.mock("./runtime-api.js", () => ({

3636

return phone ? `+${phone}` : null;

3737

},

3838

logVerbose: () => {},

39+

resolveChannelSourceReplyDeliveryMode: ({

40+

cfg,

41+

ctx,

42+

}: {

43+

cfg: {

44+

messages?: {

45+

visibleReplies?: "automatic" | "message_tool";

46+

groupChat?: { visibleReplies?: "automatic" | "message_tool" };

47+

};

48+

};

49+

ctx: { ChatType?: string; CommandSource?: "native" };

50+

}) => {

51+

if (ctx.CommandSource === "native") {

52+

return "automatic";

53+

}

54+

if (ctx.ChatType === "group" || ctx.ChatType === "channel") {

55+

const configuredMode =

56+

cfg.messages?.groupChat?.visibleReplies ?? cfg.messages?.visibleReplies;

57+

return configuredMode === "automatic" ? "automatic" : "message_tool_only";

58+

}

59+

return cfg.messages?.visibleReplies === "message_tool" ? "message_tool_only" : "automatic";

60+

},

3961

resolveChunkMode: () => "length",

4062

resolveIdentityNamePrefix: (cfg: {

4163

agents?: { list?: Array<{ id?: string; default?: boolean; identity?: { name?: string } }> };

@@ -139,6 +161,17 @@ function getCapturedOnError() {

139161

)?.dispatcherOptions?.onError;

140162

}

141163164+

function getCapturedReplyOptions() {

165+

return (

166+

capturedDispatchParams as {

167+

replyOptions?: {

168+

disableBlockStreaming?: boolean;

169+

sourceReplyDeliveryMode?: "automatic" | "message_tool_only";

170+

};

171+

}

172+

)?.replyOptions;

173+

}

174+142175

type BufferedReplyParams = Parameters<typeof dispatchWhatsAppBufferedReply>[0];

143176144177

function makeReplyLogger(): BufferedReplyParams["replyLogger"] {

@@ -575,41 +608,63 @@ describe("whatsapp inbound dispatch", () => {

575608

it("maps WhatsApp blockStreaming=true to disableBlockStreaming=false", async () => {

576609

await dispatchBufferedReply();

577610578-

expect(

579-

(

580-

capturedDispatchParams as {

581-

replyOptions?: { disableBlockStreaming?: boolean };

582-

}

583-

)?.replyOptions?.disableBlockStreaming,

584-

).toBe(false);

611+

expect(getCapturedReplyOptions()?.disableBlockStreaming).toBe(false);

585612

});

586613587614

it("maps WhatsApp blockStreaming=false to disableBlockStreaming=true", async () => {

588615

await dispatchBufferedReply({

589616

cfg: { channels: { whatsapp: { blockStreaming: false } } } as never,

590617

});

591618592-

expect(

593-

(

594-

capturedDispatchParams as {

595-

replyOptions?: { disableBlockStreaming?: boolean };

596-

}

597-

)?.replyOptions?.disableBlockStreaming,

598-

).toBe(true);

619+

expect(getCapturedReplyOptions()?.disableBlockStreaming).toBe(true);

599620

});

600621601622

it("leaves disableBlockStreaming undefined when WhatsApp blockStreaming is unset", async () => {

602623

await dispatchBufferedReply({

603624

cfg: { channels: { whatsapp: {} } } as never,

604625

});

605626606-

expect(

607-

(

608-

capturedDispatchParams as {

609-

replyOptions?: { disableBlockStreaming?: boolean };

610-

}

611-

)?.replyOptions?.disableBlockStreaming,

612-

).toBeUndefined();

627+

expect(getCapturedReplyOptions()?.disableBlockStreaming).toBeUndefined();

628+

});

629+630+

it("leaves WhatsApp direct reply mode unset by default", async () => {

631+

await dispatchBufferedReply({

632+

context: { Body: "hi", ChatType: "direct" },

633+

msg: makeMsg({ from: "+15550001000", chatType: "direct" }),

634+

});

635+636+

expect(getCapturedReplyOptions()).toMatchObject({

637+

disableBlockStreaming: false,

638+

});

639+

expect(getCapturedReplyOptions()?.sourceReplyDeliveryMode).toBeUndefined();

640+

});

641+642+

it("defaults WhatsApp group replies to message-tool-only and disables source streaming", async () => {

643+

await dispatchBufferedReply({

644+

context: { Body: "hi", ChatType: "group" },

645+

msg: makeMsg({ from: "120363000000000000@g.us", chatType: "group" }),

646+

});

647+648+

expect(getCapturedReplyOptions()).toMatchObject({

649+

sourceReplyDeliveryMode: "message_tool_only",

650+

disableBlockStreaming: true,

651+

});

652+

});

653+654+

it("honors automatic visible replies for WhatsApp groups", async () => {

655+

await dispatchBufferedReply({

656+

cfg: {

657+

channels: { whatsapp: { blockStreaming: true } },

658+

messages: { groupChat: { visibleReplies: "automatic" } },

659+

} as never,

660+

context: { Body: "hi", ChatType: "group" },

661+

msg: makeMsg({ from: "120363000000000000@g.us", chatType: "group" }),

662+

});

663+664+

expect(getCapturedReplyOptions()).toMatchObject({

665+

sourceReplyDeliveryMode: "automatic",

666+

disableBlockStreaming: false,

667+

});

613668

});

614669615670

it("treats block-only turns as visible replies instead of silent turns", async () => {