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

推荐订阅源

V
Visual Studio Blog
D
DataBreaches.Net
博客园 - 三生石上(FineUI控件)
博客园_首页
T
Tailwind CSS Blog
美团技术团队
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 聂微东
S
SegmentFault 最新的问题
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
N
Netflix TechBlog - Medium
Jina AI
Jina AI
WordPress大学
WordPress大学
U
Unit 42
J
Java Code Geeks
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare 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
test: guard before tool call mock calls · openclaw/opencl...
steipete · 2026-05-12 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -38,7 +38,7 @@ describe("runEmbeddedPiAgent cron before_agent_reply seam", () => {

3838
3939

expect(mockedGlobalHookRunner.runBeforeAgentReply).toHaveBeenCalledTimes(1);

4040

const [hookPayload, hookContext] =

41-

mockedGlobalHookRunner.runBeforeAgentReply.mock.calls[0] ?? [];

41+

mockedGlobalHookRunner.runBeforeAgentReply.mock.calls.at(0) ?? [];

4242

expect(hookPayload).toEqual({

4343

cleanedBody: "__openclaw_memory_core_short_term_promotion_dream__",

4444

});

@@ -94,7 +94,7 @@ describe("runEmbeddedPiAgent cron before_agent_reply seam", () => {

9494

promptMode: "none",

9595

});

9696
97-

const [attemptParams] = (mockedRunEmbeddedAttempt.mock.calls[0] ?? []) as [

97+

const [attemptParams] = (mockedRunEmbeddedAttempt.mock.calls.at(0) ?? []) as [

9898

{ modelRun?: boolean; promptMode?: string }?,

9999

];

100100

expect(attemptParams?.modelRun).toBe(true);

Original file line numberDiff line numberDiff line change

@@ -410,7 +410,7 @@ describe("handleToolExecutionEnd media emission", () => {

410410
411411

expect(ctx.emitToolOutput).toHaveBeenCalledTimes(1);

412412

const emitToolOutput = vi.mocked(ctx.emitToolOutput);

413-

const [toolName, summary, output, options] = emitToolOutput.mock.calls[0] ?? [];

413+

const [toolName, summary, output, options] = emitToolOutput.mock.calls.at(0) ?? [];

414414

expect(toolName).toBe("tts");

415415

expect(summary).toBeUndefined();

416416

expect(output).toBe("remote tool output");

@@ -486,7 +486,7 @@ describe("handleToolExecutionEnd media emission", () => {

486486
487487

expect(ctx.emitToolOutput).toHaveBeenCalledTimes(1);

488488

const emitToolOutput = vi.mocked(ctx.emitToolOutput);

489-

const [calledToolName, summary, output, options] = emitToolOutput.mock.calls[0] ?? [];

489+

const [calledToolName, summary, output, options] = emitToolOutput.mock.calls.at(0) ?? [];

490490

expect(calledToolName).toBe(toolName);

491491

expect(summary).toBeUndefined();

492492

expect(output).toBe(providerInventoryText);

Original file line numberDiff line numberDiff line change

@@ -83,7 +83,7 @@ describe("subscribeEmbeddedPiSession", () => {

8383

await Promise.resolve();

8484
8585

expect(onBlockReply).toHaveBeenCalledTimes(1);

86-

expect(onBlockReply.mock.calls[0]?.[0]?.text).toBe("Short chunk.");

86+

expect(onBlockReply.mock.calls.at(0)?.[0]?.text).toBe("Short chunk.");

8787

expect(onBlockReplyFlush).toHaveBeenCalledTimes(1);

8888

});

8989

@@ -157,7 +157,7 @@ describe("subscribeEmbeddedPiSession", () => {

157157

await Promise.resolve();

158158
159159

expect(onBlockReply).toHaveBeenCalledTimes(1);

160-

expect(onBlockReply.mock.calls[0]?.[0]?.text).toBe("Final reply before lifecycle end.");

160+

expect(onBlockReply.mock.calls.at(0)?.[0]?.text).toBe("Final reply before lifecycle end.");

161161

expect(onBlockReplyFlush).toHaveBeenCalledTimes(1);

162162

});

163163
Original file line numberDiff line numberDiff line change

@@ -64,7 +64,7 @@ describe("pi tool definition adapter logging", () => {

6464
6565

await def.execute("call-edit-1", { path: "notes.txt" }, undefined, undefined, extensionContext);

6666
67-

expect(vi.mocked(logError).mock.calls[0]?.[0]).toContain(

67+

expect(vi.mocked(logError).mock.calls.at(0)?.[0]).toContain(

6868

'[tools] edit failed: Missing required parameter: edits (received: path). Supply correct parameters before retrying. raw_params={"path":"notes.txt"}',

6969

);

7070

});

@@ -139,7 +139,7 @@ describe("pi tool definition adapter logging", () => {

139139

expect(details?.status).toBe("error");

140140

expect(details?.tool).toBe("web_search");

141141

expect(details?.error).toBe("This operation was aborted");

142-

expect(vi.mocked(logError).mock.calls[0]?.[0]).toContain(

142+

expect(vi.mocked(logError).mock.calls.at(0)?.[0]).toContain(

143143

"[tools] web_search failed: This operation was aborted",

144144

);

145145

});

Original file line numberDiff line numberDiff line change

@@ -1009,12 +1009,12 @@ describe("before_tool_call requireApproval handling", () => {

10091009
10101010

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

10111011

expect(mockCallGateway).toHaveBeenCalledTimes(2);

1012-

const requestCall = mockCallGateway.mock.calls[0];

1012+

const requestCall = mockCallGateway.mock.calls.at(0);

10131013

expect(requestCall?.[0]).toBe("plugin.approval.request");

10141014

requireRecord(requestCall?.[1], "approval request gateway client");

10151015

expect(requireRecord(requestCall?.[2], "approval request params").twoPhase).toBe(true);

10161016

expect(requestCall?.[3]).toEqual({ expectFinal: false });

1017-

const waitCall = mockCallGateway.mock.calls[1];

1017+

const waitCall = mockCallGateway.mock.calls.at(1);

10181018

expect(waitCall?.[0]).toBe("plugin.approval.waitDecision");

10191019

requireRecord(waitCall?.[1], "approval wait gateway client");

10201020

expect(waitCall?.[2]).toEqual({ id: "server-id-1" });

Original file line numberDiff line numberDiff line change

@@ -490,14 +490,16 @@ export async function runBeforeToolCallHook(args: {

490490

}

491491

}

492492
493-

recordToolCall(

494-

sessionState,

495-

toolName,

496-

params,

497-

args.toolCallId,

498-

args.ctx.loopDetection,

499-

loopScope,

500-

);

493+

if (args.ctx.loopDetection?.enabled !== false) {

494+

recordToolCall(

495+

sessionState,

496+

toolName,

497+

params,

498+

args.toolCallId,

499+

args.ctx.loopDetection,

500+

loopScope,

501+

);

502+

}

501503

}

502504
503505

const hookRunner = getGlobalHookRunner();