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

推荐订阅源

The Last Watchdog
The Last Watchdog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
S
Schneier on Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
Recorded Future
Recorded Future
I
Intezer
云风的 BLOG
云风的 BLOG
博客园 - Franky
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏
T
Tenable Blog
The Hacker News
The Hacker News
T
The Blog of Author Tim Ferriss
Attack and Defense Labs
Attack and Defense Labs
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
News and Events Feed by Topic
有赞技术团队
有赞技术团队
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
The Register - Security
The Register - Security
B
Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
The Cloudflare Blog
Webroot Blog
Webroot Blog
W
WeLiveSecurity
H
Heimdal Security Blog
博客园 - 三生石上(FineUI控件)
V
Vulnerabilities – Threatpost
G
Google Developers Blog
O
OpenAI News
V
V2EX
罗磊的独立博客
博客园_首页
N
News | PayPal Newsroom
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
TaoSecurity Blog
TaoSecurity Blog
Cloudbric
Cloudbric
H
Hacker News: Front Page
博客园 - 叶小钗
T
Tor Project blog
AI
AI

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: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
test: guard auto-reply dispatch mock calls · openclaw/openclaw@4ea089b
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

});