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

推荐订阅源

D
Docker
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
IT之家
IT之家
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
B
Blog RSS Feed
H
Help Net Security
Recent Announcements
Recent Announcements
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
L
LangChain Blog
Vercel News
Vercel News

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
test: guard auto-reply dispatch mock calls · openclaw/ope...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -703,7 +703,7 @@ function createMockAcpSessionManager() {

703703

}

704704705705

function firstToolResultPayload(dispatcher: ReplyDispatcher): ReplyPayload | undefined {

706-

return (dispatcher.sendToolResult as ReturnType<typeof vi.fn>).mock.calls[0]?.[0] as

706+

return (dispatcher.sendToolResult as ReturnType<typeof vi.fn>).mock.calls.at(0)?.[0] as

707707

| ReplyPayload

708708

| undefined;

709709

}

@@ -861,9 +861,9 @@ describe("dispatchReplyFromConfig", () => {

861861

const replyResolver = async () => ({ text: "hi" }) satisfies ReplyPayload;

862862

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

863863864-

const pluginLoadOptions = runtimePluginMocks.ensureRuntimePluginsLoaded.mock.calls[0]?.[0] as

865-

| { config?: unknown; workspaceDir?: unknown }

866-

| undefined;

864+

const pluginLoadOptions = runtimePluginMocks.ensureRuntimePluginsLoaded.mock.calls.at(

865+

0,

866+

)?.[0] as { config?: unknown; workspaceDir?: unknown } | undefined;

867867

expect(pluginLoadOptions?.config).toBe(cfg);

868868

expect(typeof pluginLoadOptions?.workspaceDir).toBe("string");

869869

expect(runtimePluginMocks.ensureRuntimePluginsLoaded.mock.invocationCallOrder[0]).toBeLessThan(

@@ -916,7 +916,7 @@ describe("dispatchReplyFromConfig", () => {

916916

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

917917918918

expect(dispatcher.sendFinalReply).not.toHaveBeenCalled();

919-

const routeCall = mocks.routeReply.mock.calls[0]?.[0] as

919+

const routeCall = mocks.routeReply.mock.calls.at(0)?.[0] as

920920

| {

921921

accountId?: unknown;

922922

channel?: unknown;

@@ -963,7 +963,7 @@ describe("dispatchReplyFromConfig", () => {

963963

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

964964965965

expect(dispatcher.sendFinalReply).not.toHaveBeenCalled();

966-

const routeCall = mocks.routeReply.mock.calls[0]?.[0] as

966+

const routeCall = mocks.routeReply.mock.calls.at(0)?.[0] as

967967

| { accountId?: unknown; channel?: unknown; to?: unknown }

968968

| undefined;

969969

expect(routeCall?.channel).toBe("telegram");

@@ -973,7 +973,7 @@ describe("dispatchReplyFromConfig", () => {

973973

.calls[0]?.[0] as { accountId?: unknown; messageProvider?: unknown } | undefined;

974974

expect(normalizerOptions?.messageProvider).toBe("telegram");

975975

expect(normalizerOptions?.accountId).toBe("acc-1");

976-

const replyDispatchCall = hookMocks.runner.runReplyDispatch.mock.calls[0] as

976+

const replyDispatchCall = hookMocks.runner.runReplyDispatch.mock.calls.at(0) as

977977

| [

978978

{

979979

originatingChannel?: unknown;

@@ -1012,7 +1012,7 @@ describe("dispatchReplyFromConfig", () => {

10121012

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

1013101310141014

expect(dispatcher.sendFinalReply).not.toHaveBeenCalled();

1015-

const routeCall = mocks.routeReply.mock.calls[0]?.[0] as

1015+

const routeCall = mocks.routeReply.mock.calls.at(0)?.[0] as

10161016

| { accountId?: unknown; channel?: unknown; to?: unknown }

10171017

| undefined;

10181018

expect(routeCall?.channel).toBe("discord");

@@ -1058,7 +1058,7 @@ describe("dispatchReplyFromConfig", () => {

10581058

expect(mocks.routeReply).not.toHaveBeenCalled();

10591059

expect(dispatcher.sendFinalReply).not.toHaveBeenCalled();

10601060

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

1061-

const replyDispatchCall = hookMocks.runner.runReplyDispatch.mock.calls[0] as

1061+

const replyDispatchCall = hookMocks.runner.runReplyDispatch.mock.calls.at(0) as

10621062

| [

10631063

{

10641064

originatingChannel?: unknown;

@@ -1108,7 +1108,7 @@ describe("dispatchReplyFromConfig", () => {

11081108

const replyResolver = async () => ({ text: "hi" }) satisfies ReplyPayload;

11091109

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

111011101111-

const routeCall = mocks.routeReply.mock.calls[0]?.[0] as

1111+

const routeCall = mocks.routeReply.mock.calls.at(0)?.[0] as

11121112

| { channel?: unknown; threadId?: unknown; to?: unknown }

11131113

| undefined;

11141114

expect(routeCall?.channel).toBe("discord");

@@ -1149,7 +1149,7 @@ describe("dispatchReplyFromConfig", () => {

11491149

const replyResolver = async () => ({ text: "hi" }) satisfies ReplyPayload;

11501150

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

115111511152-

const routeCall = mocks.routeReply.mock.calls[0]?.[0] as

1152+

const routeCall = mocks.routeReply.mock.calls.at(0)?.[0] as

11531153

| { channel?: string; to?: string; threadId?: string | number }

11541154

| undefined;

11551155

expect(routeCall?.channel).toBe("mattermost");

@@ -1212,7 +1212,7 @@ describe("dispatchReplyFromConfig", () => {

12121212

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

1213121312141214

expect(dispatcher.sendFinalReply).not.toHaveBeenCalled();

1215-

const routeCall = mocks.routeReply.mock.calls[0]?.[0] as

1215+

const routeCall = mocks.routeReply.mock.calls.at(0)?.[0] as

12161216

| { channel?: unknown; to?: unknown }

12171217

| undefined;

12181218

expect(routeCall?.channel).toBe("telegram");

@@ -1235,7 +1235,7 @@ describe("dispatchReplyFromConfig", () => {

12351235

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

1236123612371237

expect(dispatcher.sendFinalReply).not.toHaveBeenCalled();

1238-

const routeCall = mocks.routeReply.mock.calls[0]?.[0] as

1238+

const routeCall = mocks.routeReply.mock.calls.at(0)?.[0] as

12391239

| { channel?: unknown; to?: unknown }

12401240

| undefined;

12411241

expect(routeCall?.channel).toBe("feishu");

@@ -1305,7 +1305,7 @@ describe("dispatchReplyFromConfig", () => {

13051305

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

1306130613071307

expect(dispatcher.sendFinalReply).not.toHaveBeenCalled();

1308-

const routeCall = mocks.routeReply.mock.calls[0]?.[0] as

1308+

const routeCall = mocks.routeReply.mock.calls.at(0)?.[0] as

13091309

| { channel?: unknown; policyConversationType?: unknown; to?: unknown }

13101310

| undefined;

13111311

expect(routeCall?.channel).toBe("imessage");

@@ -1348,7 +1348,7 @@ describe("dispatchReplyFromConfig", () => {

13481348

expect(dispatcher.sendToolResult).not.toHaveBeenCalled();

13491349

expect(dispatcher.sendFinalReply).not.toHaveBeenCalled();

13501350

expect(mocks.routeReply).toHaveBeenCalledTimes(1);

1351-

const routed = mocks.routeReply.mock.calls[0]?.[0] as { payload?: ReplyPayload } | undefined;

1351+

const routed = mocks.routeReply.mock.calls.at(0)?.[0] as { payload?: ReplyPayload } | undefined;

13521352

expect(routed?.payload?.mediaUrls).toEqual(["https://example.com/tts-routed.opus"]);

13531353

expect(routed?.payload?.text).toBeUndefined();

13541354

});

@@ -1570,7 +1570,9 @@ describe("dispatchReplyFromConfig", () => {

1570157015711571

expect(dispatcher.sendToolResult).toHaveBeenCalledTimes(2);

15721572

expect(firstToolResultPayload(dispatcher)?.text).toBe("🔧 tools/sessions_send");

1573-

const sent = (dispatcher.sendToolResult as Mock).mock.calls[1]?.[0] as ReplyPayload | undefined;

1573+

const sent = (dispatcher.sendToolResult as Mock).mock.calls.at(1)?.[0] as

1574+

| ReplyPayload

1575+

| undefined;

15741576

expect(sent?.mediaUrl).toBe("https://example.com/tts-native.opus");

15751577

expect(sent?.text).toBeUndefined();

15761578

expect(dispatcher.sendFinalReply).toHaveBeenCalledTimes(1);

@@ -1615,7 +1617,7 @@ describe("dispatchReplyFromConfig", () => {

16151617

expect(firstToolResultPayload(dispatcher)?.text).toBe(

16161618

"Inspect code, patch it, run tests.\n\n1. Inspect code\n2. Patch code\n3. Run tests",

16171619

);

1618-

const secondToolPayload = (dispatcher.sendToolResult as Mock).mock.calls[1]?.[0] as

1620+

const secondToolPayload = (dispatcher.sendToolResult as Mock).mock.calls.at(1)?.[0] as

16191621

| ReplyPayload

16201622

| undefined;

16211623

expect(secondToolPayload?.text).toBe("Working: awaiting approval: pnpm test");

@@ -2055,7 +2057,7 @@ describe("dispatchReplyFromConfig", () => {

20552057

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

2056205820572059

expect(replyResolver).not.toHaveBeenCalled();

2058-

const ensureSessionOptions = runtime.ensureSession.mock.calls[0]?.[0] as

2060+

const ensureSessionOptions = runtime.ensureSession.mock.calls.at(0)?.[0] as

20592061

| { agent?: unknown; mode?: unknown; sessionKey?: unknown }

20602062

| undefined;

20612063

expect(ensureSessionOptions?.sessionKey).toBe("agent:codex-acp:session-1");

@@ -2066,7 +2068,7 @@ describe("dispatchReplyFromConfig", () => {

20662068

const streamedText = blockCalls.map((call) => (call[0] as ReplyPayload).text ?? "").join("");

20672069

expect(streamedText).toContain("hello");

20682070

expect(streamedText).toContain("world");

2069-

const finalPayload = (dispatcher.sendFinalReply as Mock).mock.calls[0]?.[0] as

2071+

const finalPayload = (dispatcher.sendFinalReply as Mock).mock.calls.at(0)?.[0] as

20702072

| ReplyPayload

20712073

| undefined;

20722074

expect(finalPayload?.text).toBe("hello world");

@@ -2401,7 +2403,7 @@ describe("dispatchReplyFromConfig", () => {

2401240324022404

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

240324052404-

const bindingLookup = sessionBindingMocks.resolveByConversation.mock.calls[0]?.[0];

2406+

const bindingLookup = sessionBindingMocks.resolveByConversation.mock.calls.at(0)?.[0];

24052407

expect(bindingLookup?.channel).toBe("discord");

24062408

expect(bindingLookup?.accountId).toBe("work");

24072409

expect(bindingLookup?.conversationId).toBe("thread-1");

@@ -2486,15 +2488,15 @@ describe("dispatchReplyFromConfig", () => {

24862488

conversationId: "C123",

24872489

});

24882490

expect(sessionBindingMocks.touch).toHaveBeenCalledWith("binding-acp-current");

2489-

const ensureSessionOptions = runtime.ensureSession.mock.calls[0]?.[0] as

2491+

const ensureSessionOptions = runtime.ensureSession.mock.calls.at(0)?.[0] as

24902492

| { agent?: unknown; sessionKey?: unknown }

24912493

| undefined;

24922494

expect(ensureSessionOptions?.sessionKey).toBe(boundSessionKey);

24932495

expect(ensureSessionOptions?.agent).toBe("opencode");

2494-

const runTurnOptions = runtime.runTurn.mock.calls[0]?.[0] as { text?: unknown } | undefined;

2496+

const runTurnOptions = runtime.runTurn.mock.calls.at(0)?.[0] as { text?: unknown } | undefined;

24952497

expect(runTurnOptions?.text).toBe("continue");

24962498

expect(replyResolver).not.toHaveBeenCalled();

2497-

const blockPayload = (dispatcher.sendBlockReply as Mock).mock.calls[0]?.[0] as

2499+

const blockPayload = (dispatcher.sendBlockReply as Mock).mock.calls.at(0)?.[0] as

24982500

| ReplyPayload

24992501

| undefined;

25002502

expect(blockPayload?.text).toBe("Bound ACP reply");

@@ -2557,7 +2559,7 @@ describe("dispatchReplyFromConfig", () => {

25572559

}

25582560

}

25592561

expect(blockTexts).toEqual(["What do you want to work on?"]);

2560-

const finalPayload = (dispatcher.sendFinalReply as Mock).mock.calls[0]?.[0] as

2562+

const finalPayload = (dispatcher.sendFinalReply as Mock).mock.calls.at(0)?.[0] as

25612563

| ReplyPayload

25622564

| undefined;

25632565

expect(finalPayload?.text).toBe("What do you want to work on?");

@@ -2642,7 +2644,7 @@ describe("dispatchReplyFromConfig", () => {

26422644

const normalizerOptions = replyMediaPathMocks.createReplyMediaPathNormalizer.mock

26432645

.calls[0]?.[0] as { messageProvider?: unknown } | undefined;

26442646

expect(normalizerOptions?.messageProvider).toBe("feishu");

2645-

const finalPayload = (dispatcher.sendFinalReply as Mock).mock.calls[0]?.[0] as

2647+

const finalPayload = (dispatcher.sendFinalReply as Mock).mock.calls.at(0)?.[0] as

26462648

| ReplyPayload

26472649

| undefined;

26482650

expect(finalPayload?.mediaUrl).toBe("/tmp/openclaw-media/normalized-tts.ogg");

@@ -2690,7 +2692,7 @@ describe("dispatchReplyFromConfig", () => {

2690269226912693

await dispatchReplyFromConfig({ ctx, cfg, dispatcher });

269226942693-

const closeOptions = runtime.close.mock.calls[0]?.[0] as { reason?: unknown } | undefined;

2695+

const closeOptions = runtime.close.mock.calls.at(0)?.[0] as { reason?: unknown } | undefined;

26942696

expect(closeOptions?.reason).toBe("oneshot-complete");

26952697

});

26962698

@@ -2799,7 +2801,7 @@ describe("dispatchReplyFromConfig", () => {

2799280128002802

expect(firstToolResultPayload(dispatcher)?.text).toBe("Approval required.");

28012803

expect(

2802-

((dispatcher.sendFinalReply as Mock).mock.calls[0]?.[0] as ReplyPayload | undefined)?.text,

2804+

((dispatcher.sendFinalReply as Mock).mock.calls.at(0)?.[0] as ReplyPayload | undefined)?.text,

28032805

).toBe("done");

28042806

});

28052807

@@ -2849,7 +2851,8 @@ describe("dispatchReplyFromConfig", () => {

2849285128502852

expect(dispatcher.sendToolResult).not.toHaveBeenCalled();

28512853

expect(

2852-

((dispatcher.sendFinalReply as Mock).mock.calls[0]?.[0] as ReplyPayload | undefined)?.text,

2854+

((dispatcher.sendFinalReply as Mock).mock.calls.at(0)?.[0] as ReplyPayload | undefined)

2855+

?.text,

28532856

).toBe("done");

28542857

} finally {

28552858

await reporter.stop();

@@ -2915,7 +2918,7 @@ describe("dispatchReplyFromConfig", () => {

29152918

const replyResolver = async () => ({ text: "hi" }) satisfies ReplyPayload;

29162919

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

291729202918-

const [event, hookContext] = hookMocks.runner.runMessageReceived.mock.calls[0] as

2921+

const [event, hookContext] = hookMocks.runner.runMessageReceived.mock.calls.at(0) as

29192922

| [

29202923

{

29212924

content?: unknown;

@@ -2976,7 +2979,7 @@ describe("dispatchReplyFromConfig", () => {

2976297929772980

expect(result).toEqual({ queuedFinal: true, counts: { tool: 0, block: 0, final: 0 } });

29782981

expect(hookMocks.runner.runInboundClaim).not.toHaveBeenCalled();

2979-

const [event, hookContext] = hookMocks.runner.runMessageReceived.mock.calls[0] as

2982+

const [event, hookContext] = hookMocks.runner.runMessageReceived.mock.calls.at(0) as

29802983

| [

29812984

{ content?: unknown; from?: unknown; metadata?: Record<string, unknown> },

29822985

{ accountId?: unknown; channelId?: unknown; conversationId?: unknown },

@@ -3003,7 +3006,7 @@ describe("dispatchReplyFromConfig", () => {

30033006

expect(internalHookEvent?.sessionKey).toBe("agent:main:hook-test");

30043007

expect(replyResolver).toHaveBeenCalledTimes(1);

30053008

expect(

3006-

((dispatcher.sendFinalReply as Mock).mock.calls[0]?.[0] as ReplyPayload | undefined)?.text,

3009+

((dispatcher.sendFinalReply as Mock).mock.calls.at(0)?.[0] as ReplyPayload | undefined)?.text,

30073010

).toBe("core reply");

30083011

});

30093012

@@ -3024,7 +3027,7 @@ describe("dispatchReplyFromConfig", () => {

30243027

const replyResolver = async () => ({ text: "hi" }) satisfies ReplyPayload;

30253028

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

302630293027-

const createHookCall = internalHookMocks.createInternalHookEvent.mock.calls[0] as

3030+

const createHookCall = internalHookMocks.createInternalHookEvent.mock.calls.at(0) as

30283031

| [

30293032

unknown,

30303033

unknown,

@@ -3084,7 +3087,7 @@ describe("dispatchReplyFromConfig", () => {

30843087

const replyResolver = async () => ({ text: "reply" }) satisfies ReplyPayload;

30853088

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

308630893087-

const createHookCall = internalHookMocks.createInternalHookEvent.mock.calls[0] as

3090+

const createHookCall = internalHookMocks.createInternalHookEvent.mock.calls.at(0) as

30883091

| [unknown, unknown, unknown, { content?: unknown; messageId?: unknown }]

30893092

| undefined;

30903093

expect(createHookCall?.[0]).toBe("message");

@@ -3116,7 +3119,7 @@ describe("dispatchReplyFromConfig", () => {

31163119

state: "processing",

31173120

reason: "message_start",

31183121

});

3119-

const processedEvent = diagnosticMocks.logMessageProcessed.mock.calls[0]?.[0] as

3122+

const processedEvent = diagnosticMocks.logMessageProcessed.mock.calls.at(0)?.[0] as

31203123

| { channel?: unknown; outcome?: unknown; sessionKey?: unknown }

31213124

| undefined;

31223125

expect(processedEvent?.channel).toBe("slack");

@@ -3559,7 +3562,7 @@ describe("dispatchReplyFromConfig", () => {

35593562

replyResolver,

35603563

});

356135643562-

const notice = (dispatcher.sendToolResult as ReturnType<typeof vi.fn>).mock.calls[0]?.[0] as

3565+

const notice = (dispatcher.sendToolResult as ReturnType<typeof vi.fn>).mock.calls.at(0)?.[0] as

35633566

| ReplyPayload

35643567

| undefined;

35653568

expect(notice?.text).toContain("is not currently loaded.");

@@ -4155,7 +4158,7 @@ describe("before_dispatch hook", () => {

4155415841564159

const result = await dispatchReplyFromConfig({ ctx, cfg: emptyConfig, dispatcher });

415741604158-

const beforeDispatchCall = hookMocks.runner.runBeforeDispatch.mock.calls[0] as

4161+

const beforeDispatchCall = hookMocks.runner.runBeforeDispatch.mock.calls.at(0) as

41594162

| [

41604163

{

41614164

body?: unknown;

@@ -4177,7 +4180,7 @@ describe("before_dispatch hook", () => {

41774180

expect(beforeDispatchCall?.[1]?.channelId).toBe("telegram");

41784181

expect(beforeDispatchCall?.[1]?.senderId).toBe("signal:user:alice");

41794182

expect(dispatcher.sendFinalReply).not.toHaveBeenCalled();

4180-

const routeCall = mocks.routeReply.mock.calls[0]?.[0] as

4183+

const routeCall = mocks.routeReply.mock.calls.at(0)?.[0] as

41814184

| { channel?: unknown; payload?: ReplyPayload; to?: unknown }

41824185

| undefined;

41834186

expect(routeCall?.channel).toBe("telegram");

@@ -4836,9 +4839,9 @@ describe("sendPolicy deny — suppress delivery, not processing (#53328)", () =>

4836483948374840

expect(replyResolver).toHaveBeenCalledTimes(1);

48384841

expect(result.queuedFinal).toBe(true);

4839-

expect((dispatcher.sendFinalReply as ReturnType<typeof vi.fn>).mock.calls[0]?.[0]?.text).toBe(

4840-

"visible direct reply",

4841-

);

4842+

expect(

4843+

(dispatcher.sendFinalReply as ReturnType<typeof vi.fn>).mock.calls.at(0)?.[0]?.text,

4844+

).toBe("visible direct reply");

48424845

});

4843484648444847

it("uses harness defaults for direct source delivery when config is unset", async () => {

@@ -4898,9 +4901,9 @@ describe("sendPolicy deny — suppress delivery, not processing (#53328)", () =>

4898490148994902

expect(replyResolver).toHaveBeenCalledTimes(1);

49004903

expect(result.queuedFinal).toBe(true);

4901-

expect((dispatcher.sendFinalReply as ReturnType<typeof vi.fn>).mock.calls[0]?.[0]?.text).toBe(

4902-

"visible fallback",

4903-

);

4904+

expect(

4905+

(dispatcher.sendFinalReply as ReturnType<typeof vi.fn>).mock.calls.at(0)?.[0]?.text,

4906+

).toBe("visible fallback");

49044907

});

4905490849064909

it("falls back to automatic group/channel delivery when group tools remove the message tool", async () => {

@@ -4934,9 +4937,9 @@ describe("sendPolicy deny — suppress delivery, not processing (#53328)", () =>

4934493749354938

expect(replyResolver).toHaveBeenCalledTimes(1);

49364939

expect(result.queuedFinal).toBe(true);

4937-

expect((dispatcher.sendFinalReply as ReturnType<typeof vi.fn>).mock.calls[0]?.[0]?.text).toBe(

4938-

"group policy fallback",

4939-

);

4940+

expect(

4941+

(dispatcher.sendFinalReply as ReturnType<typeof vi.fn>).mock.calls.at(0)?.[0]?.text,

4942+

).toBe("group policy fallback");

49404943

});

4941494449424945

it("falls back when a channel precomputed message-tool-only delivery but the message tool is unavailable", async () => {

@@ -4962,9 +4965,9 @@ describe("sendPolicy deny — suppress delivery, not processing (#53328)", () =>

4962496549634966

expect(replyResolver).toHaveBeenCalledTimes(1);

49644967

expect(result.queuedFinal).toBe(true);

4965-

expect((dispatcher.sendFinalReply as ReturnType<typeof vi.fn>).mock.calls[0]?.[0]?.text).toBe(

4966-

"requested fallback",

4967-

);

4968+

expect(

4969+

(dispatcher.sendFinalReply as ReturnType<typeof vi.fn>).mock.calls.at(0)?.[0]?.text,

4970+

).toBe("requested fallback");

49684971

});

4969497249704973

it("keeps native command replies visible in group/channel turns", async () => {

@@ -4991,9 +4994,9 @@ describe("sendPolicy deny — suppress delivery, not processing (#53328)", () =>

4991499449924995

expect(replyResolver).toHaveBeenCalledTimes(1);

49934996

expect(result.queuedFinal).toBe(true);

4994-

expect((dispatcher.sendFinalReply as ReturnType<typeof vi.fn>).mock.calls[0]?.[0]?.text).toBe(

4995-

"status reply",

4996-

);

4997+

expect(

4998+

(dispatcher.sendFinalReply as ReturnType<typeof vi.fn>).mock.calls.at(0)?.[0]?.text,

4999+

).toBe("status reply");

49975000

});

4998500149995002

it("allows config to keep group/channel source delivery automatic", async () => {

@@ -5017,8 +5020,8 @@ describe("sendPolicy deny — suppress delivery, not processing (#53328)", () =>

5017502050185021

expect(replyResolver).toHaveBeenCalledTimes(1);

50195022

expect(result.queuedFinal).toBe(true);

5020-

expect((dispatcher.sendFinalReply as ReturnType<typeof vi.fn>).mock.calls[0]?.[0]?.text).toBe(

5021-

"final reply",

5022-

);

5023+

expect(

5024+

(dispatcher.sendFinalReply as ReturnType<typeof vi.fn>).mock.calls.at(0)?.[0]?.text,

5025+

).toBe("final reply");

50235026

});

50245027

});