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

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
Engineering at Meta
Engineering at Meta
腾讯CDC
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
G
Google Developers Blog
博客园 - 三生石上(FineUI控件)
Microsoft Azure Blog
Microsoft Azure Blog
The Cloudflare Blog
aimingoo的专栏
aimingoo的专栏
T
The Blog of Author Tim Ferriss
D
Darknet – Hacking Tools, Hacker News & Cyber Security
WordPress大学
WordPress大学
博客园_首页
I
InfoQ
NISL@THU
NISL@THU
Recorded Future
Recorded Future
Security Latest
Security Latest
K
Kaspersky official blog
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
U
Unit 42
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
CERT Recently Published Vulnerability Notes
W
WeLiveSecurity
Webroot Blog
Webroot Blog
Last Week in AI
Last Week in AI
AWS News Blog
AWS News Blog
IT之家
IT之家
S
Schneier on Security
雷峰网
雷峰网
Know Your Adversary
Know Your Adversary
T
Threat Research - Cisco Blogs
C
CXSECURITY Database RSS Feed - CXSecurity.com
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
L
LangChain Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
月光博客
月光博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Stack Overflow Blog
Stack Overflow Blog
有赞技术团队
有赞技术团队
云风的 BLOG
云风的 BLOG
G
GRAHAM CLULEY
O
OpenAI News
The Last Watchdog
The Last Watchdog
TaoSecurity Blog
TaoSecurity Blog
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost

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 agent five-hit mock calls · openclaw/openclaw@69f3ac8
steipete · 2026-05-12 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -178,7 +178,7 @@ describe("anthropic transport stream", () => {

178178

);

179179
180180

expect(buildGuardedModelFetchMock).toHaveBeenCalledWith(model);

181-

const [url, init] = guardedFetchMock.mock.calls[0] ?? [];

181+

const [url, init] = guardedFetchMock.mock.calls.at(0) ?? [];

182182

expect(url).toBe("https://api.anthropic.com/v1/messages");

183183

expect(init?.method).toBe("POST");

184184

const headers = new Headers(init?.headers);

@@ -241,8 +241,8 @@ describe("anthropic transport stream", () => {

241241

} as AnthropicStreamOptions,

242242

);

243243
244-

expect(guardedFetchMock.mock.calls[0]?.[0]).toBe("https://custom-proxy.example/v1/messages");

245-

expect(guardedFetchMock.mock.calls[0]?.[1]?.method).toBe("POST");

244+

expect(guardedFetchMock.mock.calls.at(0)?.[0]).toBe("https://custom-proxy.example/v1/messages");

245+

expect(guardedFetchMock.mock.calls.at(0)?.[1]?.method).toBe("POST");

246246

expect(latestAnthropicRequestHeaders().get("anthropic-beta")).toBeNull();

247247

});

248248

@@ -468,8 +468,8 @@ describe("anthropic transport stream", () => {

468468

);

469469

const result = await stream.result();

470470
471-

expect(guardedFetchMock.mock.calls[0]?.[0]).toBe("https://api.anthropic.com/v1/messages");

472-

const headers = new Headers(guardedFetchMock.mock.calls[0]?.[1]?.headers);

471+

expect(guardedFetchMock.mock.calls.at(0)?.[0]).toBe("https://api.anthropic.com/v1/messages");

472+

const headers = new Headers(guardedFetchMock.mock.calls.at(0)?.[1]?.headers);

473473

expect(headers.get("authorization")).toBe("Bearer sk-ant-oat-example");

474474

expect(headers.get("x-app")).toBe("cli");

475475

expect(headers.get("user-agent")).toContain("claude-cli/");

Original file line numberDiff line numberDiff line change

@@ -286,7 +286,7 @@ describe("requestExecApprovalDecision", () => {

286286

ask: "always",

287287

});

288288
289-

const payload = vi.mocked(callGatewayTool).mock.calls[0]?.[2] as

289+

const payload = vi.mocked(callGatewayTool).mock.calls.at(0)?.[2] as

290290

| ApprovalRequestPayload

291291

| undefined;

292292

expect(payload?.commandSpans).toStrictEqual([

@@ -311,7 +311,7 @@ describe("requestExecApprovalDecision", () => {

311311
312312

expect(commandExplainerMock.explainShellCommand).not.toHaveBeenCalled();

313313

expect(commandExplainerMock.formatCommandSpans).not.toHaveBeenCalled();

314-

const payload = vi.mocked(callGatewayTool).mock.calls[0]?.[2] as

314+

const payload = vi.mocked(callGatewayTool).mock.calls.at(0)?.[2] as

315315

| { commandSpans?: unknown }

316316

| undefined;

317317

expect(payload?.commandSpans).toBeUndefined();

@@ -332,7 +332,7 @@ describe("requestExecApprovalDecision", () => {

332332
333333

expect(commandExplainerMock.explainShellCommand).not.toHaveBeenCalled();

334334

expect(commandExplainerMock.formatCommandSpans).not.toHaveBeenCalled();

335-

const payload = vi.mocked(callGatewayTool).mock.calls[0]?.[2] as

335+

const payload = vi.mocked(callGatewayTool).mock.calls.at(0)?.[2] as

336336

| { commandSpans?: unknown }

337337

| undefined;

338338

expect(payload?.commandSpans).toBeUndefined();

@@ -357,7 +357,7 @@ describe("requestExecApprovalDecision", () => {

357357

ask: "always",

358358

});

359359
360-

const payload = vi.mocked(callGatewayTool).mock.calls[0]?.[2] as

360+

const payload = vi.mocked(callGatewayTool).mock.calls.at(0)?.[2] as

361361

| ApprovalRequestPayload

362362

| undefined;

363363

expect(payload?.commandSpans).toStrictEqual([{ startIndex: 0, endIndex: 4 }]);

@@ -444,7 +444,7 @@ describe("requestExecApprovalDecision", () => {

444444

ask: "always",

445445

});

446446
447-

const payload = vi.mocked(callGatewayTool).mock.calls[0]?.[2] as

447+

const payload = vi.mocked(callGatewayTool).mock.calls.at(0)?.[2] as

448448

| ApprovalRequestPayload

449449

| undefined;

450450

expect(payload?.commandSpans).toEqual([{ startIndex: 0, endIndex: 4 }]);

Original file line numberDiff line numberDiff line change

@@ -311,7 +311,7 @@ describe("processGatewayAllowlist", () => {

311311

sessionKey: "agent:main:telegram:direct:123",

312312

});

313313
314-

const followupTargetInput = buildExecApprovalFollowupTargetMock.mock.calls[0]?.[0] as

314+

const followupTargetInput = buildExecApprovalFollowupTargetMock.mock.calls.at(0)?.[0] as

315315

| { sessionKey?: string }

316316

| undefined;

317317

expect(followupTargetInput?.sessionKey).toBe("agent:main:telegram:direct:123");

@@ -375,24 +375,24 @@ describe("processGatewayAllowlist", () => {

375375

await vi.waitFor(() => {

376376

expect(sendExecApprovalFollowupResultMock).toHaveBeenCalledTimes(1);

377377

});

378-

const followupTargetInput = buildExecApprovalFollowupTargetMock.mock.calls[0]?.[0] as

378+

const followupTargetInput = buildExecApprovalFollowupTargetMock.mock.calls.at(0)?.[0] as

379379

| { direct?: boolean }

380380

| undefined;

381381

expect(followupTargetInput?.direct).toBe(true);

382382
383-

const followupTarget = sendExecApprovalFollowupResultMock.mock.calls[0]?.[0] as

383+

const followupTarget = sendExecApprovalFollowupResultMock.mock.calls.at(0)?.[0] as

384384

| { direct?: boolean }

385385

| null

386386

| undefined;

387387

expect(followupTarget?.direct).toBe(true);

388-

const followupText = sendExecApprovalFollowupResultMock.mock.calls[0]?.[1] ?? "";

388+

const followupText = sendExecApprovalFollowupResultMock.mock.calls.at(0)?.[1] ?? "";

389389

expect(followupText).toContain("Diagnostics export created.");

390390

expect(followupText).toContain("Path: /tmp/openclaw-diagnostics.zip");

391391

expect(followupText).toContain("Contents (2 files):");

392392

expect(followupText).toContain("OpenAI Codex harness:");

393393

expect(followupText).toContain("Codex diagnostics sent to OpenAI servers:");

394394

expect(followupText).toContain("Codex thread id: `thread-1`");

395-

const approvalInput = approvalFollowup.mock.calls[0]?.[0] as

395+

const approvalInput = approvalFollowup.mock.calls.at(0)?.[0] as

396396

| {

397397

approvalId?: string;

398398

sessionId?: string;

Original file line numberDiff line numberDiff line change

@@ -28,8 +28,8 @@ describe("subscribeEmbeddedPiSession", () => {

2828

emitAssistantTextDelta({ emit, delta: "<final>Hi there</final>" });

2929
3030

expect(onPartialReply).toHaveBeenCalledTimes(1);

31-

const firstPayload = onPartialReply.mock.calls[0][0];

32-

expect(firstPayload.text).toBe("Hi there");

31+

const firstPayload = onPartialReply.mock.calls.at(0)?.[0];

32+

expect(firstPayload?.text).toBe("Hi there");

3333
3434

onPartialReply.mockClear();

3535

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

7777

emitAssistantTextDelta({ emit, delta: "<final>Hello world</final>" });

7878
7979

expect(onPartialReply).toHaveBeenCalledTimes(1);

80-

expect(onPartialReply.mock.calls[0][0].text).toBe("Hello world");

80+

expect(onPartialReply.mock.calls.at(0)?.[0]?.text).toBe("Hello world");

8181

});

8282
8383

it("strips final tags split across streamed deltas without emitting tag remnants", () => {

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

183183

await Promise.resolve();

184184
185185

expect(onBlockReply).toHaveBeenCalledTimes(1);

186-

expect(onBlockReply.mock.calls[0]?.[0]?.text).toBe("Answer ends with <fi");

186+

expect(onBlockReply.mock.calls.at(0)?.[0]?.text).toBe("Answer ends with <fi");

187187

});

188188
189189

it("keeps a trailing final-tag prefix when synchronous message_end drains chunked text_end replies", async () => {

@@ -246,8 +246,8 @@ describe("subscribeEmbeddedPiSession", () => {

246246
247247

emitAssistantTextDelta({ emit, delta: "Hello world" });

248248
249-

const payload = onPartialReply.mock.calls[0][0];

250-

expect(payload.text).toBe("Hello world");

249+

const payload = onPartialReply.mock.calls.at(0)?.[0];

250+

expect(payload?.text).toBe("Hello world");

251251

});

252252

it("emits block replies on message_end", async () => {

253253

const { session, emit } = createStubSessionHarness();

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

270270

await Promise.resolve();

271271
272272

expect(onBlockReply).toHaveBeenCalledTimes(1);

273-

const payload = onBlockReply.mock.calls[0][0];

274-

expect(payload.text).toBe("Hello block");

273+

const payload = onBlockReply.mock.calls.at(0)?.[0];

274+

expect(payload?.text).toBe("Hello block");

275275

});

276276

});

Original file line numberDiff line numberDiff line change

@@ -20,8 +20,8 @@ describe("subscribeEmbeddedPiSession", () => {

2020

emitAssistantTextDeltaAndEnd({ emit, text });

2121
2222

expect(onBlockReply).toHaveBeenCalledTimes(2);

23-

expect(onBlockReply.mock.calls[0][0].text).toBe("First block line");

24-

expect(onBlockReply.mock.calls[1][0].text).toBe("Second block line");

23+

expect(onBlockReply.mock.calls.at(0)?.[0]?.text).toBe("First block line");

24+

expect(onBlockReply.mock.calls.at(1)?.[0]?.text).toBe("Second block line");

2525

expect(subscription.assistantTexts).toEqual(["First block line", "Second block line"]);

2626

});

2727

it("avoids splitting inside fenced code blocks", () => {

@@ -39,8 +39,8 @@ describe("subscribeEmbeddedPiSession", () => {

3939

emitAssistantTextDeltaAndEnd({ emit, text });

4040
4141

expect(onBlockReply).toHaveBeenCalledTimes(3);

42-

expect(onBlockReply.mock.calls[0][0].text).toBe("Intro");

43-

expect(onBlockReply.mock.calls[1][0].text).toBe("```bash\nline1\nline2\n```");

44-

expect(onBlockReply.mock.calls[2][0].text).toBe("Outro");

42+

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

43+

expect(onBlockReply.mock.calls.at(1)?.[0]?.text).toBe("```bash\nline1\nline2\n```");

44+

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

4545

});

4646

});

Original file line numberDiff line numberDiff line change

@@ -144,8 +144,8 @@ describe("subscribeEmbeddedPiSession", () => {

144144

await Promise.resolve();

145145
146146

expect(onToolResult).toHaveBeenCalledTimes(1);

147-

const payload = onToolResult.mock.calls[0][0];

148-

expect(payload.text).toContain("/tmp/a.txt");

147+

const payload = onToolResult.mock.calls.at(0)?.[0];

148+

expect(payload?.text).toContain("/tmp/a.txt");

149149
150150

toolHarness.emit({

151151

type: "tool_execution_end",

@@ -177,10 +177,10 @@ describe("subscribeEmbeddedPiSession", () => {

177177

await Promise.resolve();

178178
179179

expect(onToolResult).toHaveBeenCalledTimes(1);

180-

const payload = onToolResult.mock.calls[0][0];

181-

expect(payload.text).toContain("🌐");

182-

expect(payload.text).toContain("Browser");

183-

expect(payload.text).toContain("https://example.com");

180+

const payload = onToolResult.mock.calls.at(0)?.[0];

181+

expect(payload?.text).toContain("🌐");

182+

expect(payload?.text).toContain("Browser");

183+

expect(payload?.text).toContain("https://example.com");

184184

});

185185
186186

it("emits exec output in full verbose mode and includes PTY indicator", async () => {

@@ -202,9 +202,9 @@ describe("subscribeEmbeddedPiSession", () => {

202202

await Promise.resolve();

203203
204204

expect(onToolResult).toHaveBeenCalledTimes(1);

205-

const summary = onToolResult.mock.calls[0][0];

206-

expect(summary.text).toContain("Exec");

207-

expect(summary.text).toContain("pty");

205+

const summary = onToolResult.mock.calls.at(0)?.[0];

206+

expect(summary?.text).toContain("pty");

207+

expect(summary?.text).toContain("claude");

208208
209209

toolHarness.emit({

210210

type: "tool_execution_end",

@@ -217,9 +217,9 @@ describe("subscribeEmbeddedPiSession", () => {

217217

await Promise.resolve();

218218
219219

expect(onToolResult).toHaveBeenCalledTimes(2);

220-

const output = onToolResult.mock.calls[1][0];

221-

expect(output.text).toContain("hello");

222-

expect(output.text).toContain("```txt");

220+

const output = onToolResult.mock.calls.at(1)?.[0];

221+

expect(output?.text).toContain("hello");

222+

expect(output?.text).toContain("```txt");

223223
224224

toolHarness.emit({

225225

type: "tool_execution_end",

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

232232

await Promise.resolve();

233233
234234

expect(onToolResult).toHaveBeenCalledTimes(3);

235-

const readOutput = onToolResult.mock.calls[2][0];

236-

expect(readOutput.text).toContain("file data");

235+

const readOutput = onToolResult.mock.calls.at(2)?.[0];

236+

expect(readOutput?.text).toContain("file data");

237237

});

238238

});

Original file line numberDiff line numberDiff line change

@@ -178,13 +178,13 @@ describe("ssh sandbox backend", () => {

178178

configLabelMatch: true,

179179

});

180180

const sessionSettings = requireRecord(

181-

sshMocks.createSshSandboxSessionFromSettings.mock.calls[0]?.[0],

181+

sshMocks.createSshSandboxSessionFromSettings.mock.calls.at(0)?.[0],

182182

"ssh session settings",

183183

);

184184

expect(sessionSettings.target).toBe("peter@example.com:2222");

185185

expect(sessionSettings.workspaceRoot).toBe("/remote/openclaw");

186186

const commandParams = requireRecord(

187-

sshMocks.runSshSandboxCommand.mock.calls[0]?.[0],

187+

sshMocks.runSshSandboxCommand.mock.calls.at(0)?.[0],

188188

"ssh run command params",

189189

);

190190

expect(commandParams.remoteCommand).toContain("/remote/openclaw/openclaw-ssh-agent-worker");

@@ -206,7 +206,7 @@ describe("ssh sandbox backend", () => {

206206

});

207207
208208

const commandParams = requireRecord(

209-

sshMocks.runSshSandboxCommand.mock.calls[0]?.[0],

209+

sshMocks.runSshSandboxCommand.mock.calls.at(0)?.[0],

210210

"ssh run command params",

211211

);

212212

expect(commandParams.allowFailure).toBe(true);

@@ -294,13 +294,13 @@ describe("ssh sandbox backend", () => {

294294

expect(execSpec.argv.at(-1)).toContain("/remote/openclaw/openclaw-ssh-agent-worker");

295295

expect(sshMocks.uploadDirectoryToSshTarget).toHaveBeenCalledTimes(2);

296296

const workspaceUploadParams = requireRecord(

297-

sshMocks.uploadDirectoryToSshTarget.mock.calls[0]?.[0],

297+

sshMocks.uploadDirectoryToSshTarget.mock.calls.at(0)?.[0],

298298

"workspace upload params",

299299

);

300300

expect(workspaceUploadParams.localDir).toBe("/tmp/workspace");

301301

expect(workspaceUploadParams.remoteDir).toContain("/workspace");

302302

const agentUploadParams = requireRecord(

303-

sshMocks.uploadDirectoryToSshTarget.mock.calls[1]?.[0],

303+

sshMocks.uploadDirectoryToSshTarget.mock.calls.at(1)?.[0],

304304

"agent upload params",

305305

);

306306

expect(agentUploadParams.localDir).toBe("/tmp/agent");

Original file line numberDiff line numberDiff line change

@@ -131,7 +131,7 @@ function mockAgentStartFailure() {

131131

}

132132
133133

function getSpawnedEventCall(): Record<string, unknown> {

134-

const [event] = (hookRunnerMocks.runSubagentSpawned.mock.calls[0] ?? []) as unknown as [

134+

const [event] = (hookRunnerMocks.runSubagentSpawned.mock.calls.at(0) ?? []) as unknown as [

135135

Record<string, unknown>,

136136

];

137137

return event;

@@ -242,8 +242,9 @@ describe("sessions_spawn subagent lifecycle hooks", () => {

242242
243243

expectFields(result, { status: "accepted", runId: "run-1" }, "spawn result");

244244

expect(hookRunnerMocks.runSubagentSpawning).toHaveBeenCalledTimes(1);

245-

const [spawningEvent, spawningContext] = (hookRunnerMocks.runSubagentSpawning.mock.calls[0] ??

246-

[]) as unknown as [Record<string, unknown>, Record<string, unknown>];

245+

const [spawningEvent, spawningContext] = (hookRunnerMocks.runSubagentSpawning.mock.calls.at(

246+

0,

247+

) ?? []) as unknown as [Record<string, unknown>, Record<string, unknown>];

247248

const spawningChildSessionKey = expectSubagentSessionKey(

248249

spawningEvent?.childSessionKey,

249250

"spawning event child session key",

@@ -275,7 +276,7 @@ describe("sessions_spawn subagent lifecycle hooks", () => {

275276

);

276277
277278

expect(hookRunnerMocks.runSubagentSpawned).toHaveBeenCalledTimes(1);

278-

const [event, ctx] = (hookRunnerMocks.runSubagentSpawned.mock.calls[0] ?? []) as unknown as [

279+

const [event, ctx] = (hookRunnerMocks.runSubagentSpawned.mock.calls.at(0) ?? []) as unknown as [

279280

Record<string, unknown>,

280281

Record<string, unknown>,

281282

];

@@ -321,7 +322,7 @@ describe("sessions_spawn subagent lifecycle hooks", () => {

321322

expectFields(result, { status: "accepted", runId: "run-1" }, "spawn result");

322323

expect(hookRunnerMocks.runSubagentSpawning).not.toHaveBeenCalled();

323324

expect(hookRunnerMocks.runSubagentSpawned).toHaveBeenCalledTimes(1);

324-

const [event] = (hookRunnerMocks.runSubagentSpawned.mock.calls[0] ?? []) as unknown as [

325+

const [event] = (hookRunnerMocks.runSubagentSpawned.mock.calls.at(0) ?? []) as unknown as [

325326

Record<string, unknown>,

326327

];

327328

expectFields(

@@ -440,7 +441,7 @@ describe("sessions_spawn subagent lifecycle hooks", () => {

440441
441442

expect(result.status).toBe("error");

442443

expect(hookRunnerMocks.runSubagentEnded).toHaveBeenCalledTimes(1);

443-

const [event] = (hookRunnerMocks.runSubagentEnded.mock.calls[0] ?? []) as unknown as [

444+

const [event] = (hookRunnerMocks.runSubagentEnded.mock.calls.at(0) ?? []) as unknown as [

444445

Record<string, unknown>,

445446

];

446447

expectSubagentSessionKey(event.targetSessionKey, "ended event target session key");