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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
H
Help Net Security
Microsoft Security Blog
Microsoft Security Blog
The Cloudflare Blog
S
SegmentFault 最新的问题
小众软件
小众软件
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 司徒正美
The GitHub Blog
The GitHub Blog
量子位
H
Hackread – Cybersecurity News, Data Breaches, AI and More
V
V2EX
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
J
Java Code Geeks
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
Blog — PlanetScale
Blog — PlanetScale
Last Week in AI
Last Week in 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: guard agent seven-hit mock calls · openclaw/opencla...
steipete · 2026-05-12 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -437,7 +437,7 @@ describe("runEmbeddedPiAgent incomplete-turn safety", () => {

437437

});

438438
439439

expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(2);

440-

const secondCall = mockedRunEmbeddedAttempt.mock.calls[1]?.[0] as { prompt?: string };

440+

const secondCall = mockedRunEmbeddedAttempt.mock.calls.at(1)?.[0] as { prompt?: string };

441441

expect(secondCall.prompt).toContain(REASONING_ONLY_RETRY_INSTRUCTION);

442442

expectWarnMessageWith("reasoning-only assistant turn detected");

443443

});

@@ -472,7 +472,7 @@ describe("runEmbeddedPiAgent incomplete-turn safety", () => {

472472

});

473473
474474

expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(1);

475-

const onlyCall = mockedRunEmbeddedAttempt.mock.calls[0]?.[0] as { prompt?: string };

475+

const onlyCall = mockedRunEmbeddedAttempt.mock.calls.at(0)?.[0] as { prompt?: string };

476476

expect(onlyCall.prompt).not.toContain(REASONING_ONLY_RETRY_INSTRUCTION);

477477

expect(onlyCall.prompt).not.toContain(EMPTY_RESPONSE_RETRY_INSTRUCTION);

478478

expectNoWarnMessageWith("reasoning-only assistant turn detected");

@@ -641,7 +641,7 @@ describe("runEmbeddedPiAgent incomplete-turn safety", () => {

641641

});

642642
643643

expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(2);

644-

const secondCall = mockedRunEmbeddedAttempt.mock.calls[1]?.[0] as { prompt?: string };

644+

const secondCall = mockedRunEmbeddedAttempt.mock.calls.at(1)?.[0] as { prompt?: string };

645645

expect(secondCall.prompt).toContain(REASONING_ONLY_RETRY_INSTRUCTION);

646646

expectWarnMessageWith("reasoning-only assistant turn detected");

647647

});

@@ -681,7 +681,7 @@ describe("runEmbeddedPiAgent incomplete-turn safety", () => {

681681

});

682682
683683

expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(2);

684-

const secondCall = mockedRunEmbeddedAttempt.mock.calls[1]?.[0] as { prompt?: string };

684+

const secondCall = mockedRunEmbeddedAttempt.mock.calls.at(1)?.[0] as { prompt?: string };

685685

expect(secondCall.prompt).toContain(EMPTY_RESPONSE_RETRY_INSTRUCTION);

686686

expectWarnMessageWith("empty response detected");

687687

});

@@ -735,7 +735,7 @@ describe("runEmbeddedPiAgent incomplete-turn safety", () => {

735735

});

736736
737737

expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(2);

738-

const secondCall = mockedRunEmbeddedAttempt.mock.calls[1]?.[0] as { prompt?: string };

738+

const secondCall = mockedRunEmbeddedAttempt.mock.calls.at(1)?.[0] as { prompt?: string };

739739

expect(secondCall.prompt).toContain(EMPTY_RESPONSE_RETRY_INSTRUCTION);

740740

expectWarnMessageWith("empty response detected");

741741

});

@@ -804,7 +804,7 @@ describe("runEmbeddedPiAgent incomplete-turn safety", () => {

804804

});

805805
806806

expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(2);

807-

const secondCall = mockedRunEmbeddedAttempt.mock.calls[1]?.[0] as { prompt?: string };

807+

const secondCall = mockedRunEmbeddedAttempt.mock.calls.at(1)?.[0] as { prompt?: string };

808808

expect(secondCall.prompt).toContain(EMPTY_RESPONSE_RETRY_INSTRUCTION);

809809

expectWarnMessageWith("empty response detected");

810810

});

@@ -1923,7 +1923,7 @@ describe("runEmbeddedPiAgent incomplete-turn safety", () => {

19231923

});

19241924
19251925

expect(mockedRunEmbeddedAttempt).toHaveBeenCalledTimes(1);

1926-

const onlyCall = mockedRunEmbeddedAttempt.mock.calls[0]?.[0] as { prompt?: string };

1926+

const onlyCall = mockedRunEmbeddedAttempt.mock.calls.at(0)?.[0] as { prompt?: string };

19271927

expect(onlyCall.prompt).not.toContain(REASONING_ONLY_RETRY_INSTRUCTION);

19281928

expect(onlyCall.prompt).not.toContain(EMPTY_RESPONSE_RETRY_INSTRUCTION);

19291929

expect(result.payloads).toEqual([{ text: "NO_REPLY" }]);

Original file line numberDiff line numberDiff line change

@@ -257,7 +257,7 @@ describe("runEmbeddedPiAgent overflow compaction trigger routing", () => {

257257

});

258258
259259

expect(mockedEnsureAuthProfileStore).not.toHaveBeenCalled();

260-

const authStoreCall = mockedEnsureAuthProfileStoreWithoutExternalProfiles.mock.calls[0] as

260+

const authStoreCall = mockedEnsureAuthProfileStoreWithoutExternalProfiles.mock.calls.at(0) as

261261

| [string | undefined, { allowKeychainPrompt?: boolean } | undefined]

262262

| undefined;

263263

expect(typeof authStoreCall?.[0]).toBe("string");

@@ -297,7 +297,7 @@ describe("runEmbeddedPiAgent overflow compaction trigger routing", () => {

297297

expect(typeof forwardedTools.normalize).toBe("function");

298298

const forwardedTransport = expectRecordFields(forwardedPlan.transport, {});

299299

expect(typeof forwardedTransport.resolveExtraParams).toBe("function");

300-

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

300+

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

301301

| EmbeddedRunAttemptParams

302302

| undefined;

303303

expect(attemptParams?.runtimePlan).toBe(runtimePlan);

@@ -395,7 +395,7 @@ describe("runEmbeddedPiAgent overflow compaction trigger routing", () => {

395395

forwardedAuthProfileId: "openai-codex:work",

396396

},

397397

});

398-

const harnessParams = pluginRunAttempt.mock.calls[0]?.[0];

398+

const harnessParams = pluginRunAttempt.mock.calls.at(0)?.[0];

399399

expect(harnessParams?.runtimePlan).toBe(runtimePlan);

400400

expect(Object.keys(harnessParams?.authProfileStore.profiles ?? {})).toEqual([

401401

"openai-codex:work",

@@ -472,7 +472,7 @@ describe("runEmbeddedPiAgent overflow compaction trigger routing", () => {

472472

forwardedAuthProfileId: "openai-codex:work",

473473

},

474474

});

475-

const harnessParams = pluginRunAttempt.mock.calls[0]?.[0];

475+

const harnessParams = pluginRunAttempt.mock.calls.at(0)?.[0];

476476

expect(harnessParams?.runtimePlan).toBe(runtimePlan);

477477

expect(mockedMarkAuthProfileSuccess).toHaveBeenCalledTimes(1);

478478

const [[successParams]] = mockedMarkAuthProfileSuccess.mock.calls as unknown as Array<

@@ -549,7 +549,7 @@ describe("runEmbeddedPiAgent overflow compaction trigger routing", () => {

549549

forwardedAuthProfileId: "openai-codex:default",

550550

},

551551

});

552-

const harnessParams = pluginRunAttempt.mock.calls[0]?.[0];

552+

const harnessParams = pluginRunAttempt.mock.calls.at(0)?.[0];

553553

expect(harnessParams?.runtimePlan).toBe(runtimePlan);

554554

});

555555

@@ -622,7 +622,7 @@ describe("runEmbeddedPiAgent overflow compaction trigger routing", () => {

622622

forwardedAuthProfileId: "openai-codex:default",

623623

},

624624

});

625-

const harnessParams = pluginRunAttempt.mock.calls[0]?.[0];

625+

const harnessParams = pluginRunAttempt.mock.calls.at(0)?.[0];

626626

expect(harnessParams?.runtimePlan).toBe(runtimePlan);

627627

});

628628

@@ -707,7 +707,7 @@ describe("runEmbeddedPiAgent overflow compaction trigger routing", () => {

707707

forwardedAuthProfileId: "openai:personal",

708708

},

709709

});

710-

const harnessParams = pluginRunAttempt.mock.calls[0]?.[0];

710+

const harnessParams = pluginRunAttempt.mock.calls.at(0)?.[0];

711711

expect(harnessParams?.runtimePlan).toBe(runtimePlan);

712712

expect(Object.keys(harnessParams?.authProfileStore.profiles ?? {})).toEqual([

713713

"openai:personal",

Original file line numberDiff line numberDiff line change

@@ -1308,7 +1308,7 @@ describe("compaction-safeguard recent-turn preservation", () => {

13081308
13091309

expect(result.cancel).not.toBe(true);

13101310

expect(mockSummarizeInStages).toHaveBeenCalledTimes(1);

1311-

const droppedCall = mockSummarizeInStages.mock.calls[0]?.[0];

1311+

const droppedCall = mockSummarizeInStages.mock.calls.at(0)?.[0];

13121312

expect(droppedCall?.customInstructions).toContain(

13131313

"Produce a compact, factual summary with these exact section headings:",

13141314

);

@@ -1351,7 +1351,7 @@ describe("compaction-safeguard recent-turn preservation", () => {

13511351
13521352

await compactionHandler(event, mockContext);

13531353
1354-

const call = mockSummarizeInStages.mock.calls[0]?.[0];

1354+

const call = mockSummarizeInStages.mock.calls.at(0)?.[0];

13551355

expect(call?.reserveTokens).toBe(128_000);

13561356

});

13571357

@@ -1539,7 +1539,7 @@ describe("compaction-safeguard recent-turn preservation", () => {

15391539
15401540

expect(result.cancel).not.toBe(true);

15411541

expect(mockSummarizeInStages).toHaveBeenCalledTimes(2);

1542-

const secondCall = mockSummarizeInStages.mock.calls[1]?.[0];

1542+

const secondCall = mockSummarizeInStages.mock.calls.at(1)?.[0];

15431543

expect(secondCall?.customInstructions).toContain("Quality check feedback");

15441544

expect(secondCall?.customInstructions).toContain("missing_section:## Decisions");

15451545

});

@@ -1626,7 +1626,7 @@ describe("compaction-safeguard recent-turn preservation", () => {

16261626
16271627

expect(result.cancel).not.toBe(true);

16281628

expect(mockSummarizeInStages).toHaveBeenCalledTimes(2);

1629-

const secondCall = mockSummarizeInStages.mock.calls[1]?.[0];

1629+

const secondCall = mockSummarizeInStages.mock.calls.at(1)?.[0];

16301630

expect(secondCall?.customInstructions).toContain("latest_user_ask_not_reflected");

16311631

});

16321632

@@ -1817,7 +1817,7 @@ describe("compaction-safeguard recent-turn preservation", () => {

18171817
18181818

expect(result.cancel).not.toBe(true);

18191819

expect(mockSummarizeInStages).toHaveBeenCalledTimes(1);

1820-

const call = mockSummarizeInStages.mock.calls[0]?.[0];

1820+

const call = mockSummarizeInStages.mock.calls.at(0)?.[0];

18211821

expect(call?.previousSummary).toBeUndefined();

18221822

expect(JSON.stringify(call?.messages[0])).toContain("<previous-compaction-summary>");

18231823

expect(JSON.stringify(call?.messages[0])).toContain("Old duplicated section");

@@ -1880,14 +1880,14 @@ describe("compaction-safeguard recent-turn preservation", () => {

18801880

const compaction = expectCompactionResult(result);

18811881

expect(getApiKeyAndHeadersMock).not.toHaveBeenCalled();

18821882

expect(mockSummarizeInStages).not.toHaveBeenCalled();

1883-

const providerInput = providerSummarize.mock.calls[0]?.[0];

1883+

const providerInput = providerSummarize.mock.calls.at(0)?.[0];

18841884

expect(providerInput?.previousSummary).toBe("previous provider summary");

18851885

expect(providerInput?.customInstructions).toContain("Keep milestone names.");

18861886

expect(providerInput?.summarizationInstructions).toEqual({

18871887

identifierPolicy: "custom",

18881888

identifierInstructions: "Preserve ticket IDs exactly.",

18891889

});

1890-

const providerMessages = providerSummarize.mock.calls[0]?.[0]?.messages ?? [];

1890+

const providerMessages = providerSummarize.mock.calls.at(0)?.[0]?.messages ?? [];

18911891

expect(JSON.stringify(providerMessages)).not.toContain("openclaw.runtime-context");

18921892

expect(JSON.stringify(providerMessages)).not.toContain("secret runtime context");

18931893

expect(compaction.summary).toContain("provider summary body");

Original file line numberDiff line numberDiff line change

@@ -115,7 +115,7 @@ function expectFields(value: unknown, expected: Record<string, unknown>): void {

115115

}

116116
117117

function firstCallArg(mock: ReturnType<typeof vi.fn>): Record<string, unknown> {

118-

const [arg] = mock.mock.calls[0] ?? [];

118+

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

119119

if (!arg || typeof arg !== "object") {

120120

throw new Error("expected first call argument object");

121121

}

@@ -206,8 +206,8 @@ describe("subagent registry lifecycle hardening", () => {

206206

).resolves.toBeUndefined();

207207
208208

expect(warn).toHaveBeenCalledTimes(1);

209-

expect(warn.mock.calls[0]?.[0]).toBe("failed to finalize subagent background task state");

210-

expectFields(warn.mock.calls[0]?.[1], {

209+

expect(warn.mock.calls.at(0)?.[0]).toBe("failed to finalize subagent background task state");

210+

expectFields(warn.mock.calls.at(0)?.[1], {

211211

error: { name: "Error", message: "task store boom" },

212212

runId: "***",

213213

childSessionKey: "agent:main:…",

@@ -250,10 +250,10 @@ describe("subagent registry lifecycle hardening", () => {

250250

).resolves.toBeUndefined();

251251
252252

expect(warn).toHaveBeenCalledTimes(1);

253-

expect(warn.mock.calls[0]?.[0]).toBe(

253+

expect(warn.mock.calls.at(0)?.[0]).toBe(

254254

"failed to update subagent background task delivery state",

255255

);

256-

expectFields(warn.mock.calls[0]?.[1], {

256+

expectFields(warn.mock.calls.at(0)?.[1], {

257257

error: { name: "Error", message: "delivery state boom" },

258258

runId: "***",

259259

childSessionKey: "agent:main:…",

@@ -677,10 +677,10 @@ describe("subagent registry lifecycle hardening", () => {

677677

).resolves.toBeUndefined();

678678
679679

expect(warn).toHaveBeenCalledTimes(1);

680-

expect(warn.mock.calls[0]?.[0]).toBe(

680+

expect(warn.mock.calls.at(0)?.[0]).toBe(

681681

"failed to update subagent background task delivery state",

682682

);

683-

expectFields(warn.mock.calls[0]?.[1], {

683+

expectFields(warn.mock.calls.at(0)?.[1], {

684684

error: { name: "Error", message: "delivery status boom" },

685685

deliveryStatus: "delivered",

686686

});