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

推荐订阅源

I
InfoQ
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
月光博客
月光博客
博客园 - 聂微东
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
A
About on SuperTechFans
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
S
SegmentFault 最新的问题
F
Fortinet All Blogs
H
Help Net Security
J
Java Code Geeks
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
L
LangChain Blog
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium

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 helper assertions · openclaw/openc...
steipete · 2026-05-12 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -299,7 +299,6 @@ function expectRecordFields(record: Record<string, unknown>, fields: Record<stri

299299
300300

function requireMockCall(mock: unknown, index: number, label: string): unknown[] {

301301

const call = (mock as { mock?: { calls?: unknown[][] } }).mock?.calls?.[index];

302-

expect(call).toBeDefined();

303302

if (!call) {

304303

throw new Error(`missing ${label} call ${index + 1}`);

305304

}

@@ -343,7 +342,6 @@ function requireMockCallArgWithFields(

343342

const record = value as Record<string, unknown>;

344343

return Object.entries(fields).every(([key, expected]) => record[key] === expected);

345344

});

346-

expect(found).toBeDefined();

347345

if (!found) {

348346

throw new Error(`missing ${label}`);

349347

}

Original file line numberDiff line numberDiff line change

@@ -51,7 +51,6 @@ function requireRecord(value: unknown, label: string): Record<string, unknown> {

5151
5252

function mockCallArgs(mock: ReturnType<typeof vi.fn>, label: string, callIndex = 0): unknown[] {

5353

const call = mock.mock.calls[callIndex] as unknown[] | undefined;

54-

expect(call).toBeDefined();

5554

if (!call) {

5655

throw new Error(`expected ${label} mock call ${callIndex}`);

5756

}

Original file line numberDiff line numberDiff line change

@@ -598,15 +598,19 @@ type MockWithCalls = {

598598
599599

function mockCallArg(mock: MockWithCalls, callIndex = 0, argIndex = 0): unknown {

600600

const call = mock.mock.calls[callIndex];

601-

expect(call).toBeDefined();

602-

return call?.[argIndex];

601+

if (!call) {

602+

throw new Error(`Expected mock call ${callIndex}`);

603+

}

604+

return call[argIndex];

603605

}

604606
605607

function expectRecordFields(

606608

record: unknown,

607609

expected: Record<string, unknown>,

608610

): Record<string, unknown> {

609-

expect(record).toBeDefined();

611+

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

612+

throw new Error("Expected record");

613+

}

610614

const actual = record as Record<string, unknown>;

611615

for (const [key, value] of Object.entries(expected)) {

612616

expect(actual[key]).toEqual(value);

Original file line numberDiff line numberDiff line change

@@ -36,7 +36,6 @@ function requireRecord(value: unknown, label: string): Record<string, unknown> {

3636
3737

function gatewayRequest(callIndex = 0) {

3838

const call = callGatewayMock.mock.calls[callIndex] as unknown[] | undefined;

39-

expect(call).toBeDefined();

4039

if (!call) {

4140

throw new Error(`expected gateway call ${callIndex}`);

4241

}

Original file line numberDiff line numberDiff line change

@@ -26,8 +26,10 @@ function buildParams(commandBody: string) {

2626

function mockCall(mock: unknown, index = 0): Array<unknown> {

2727

const calls = (mock as { mock?: { calls?: Array<Array<unknown>> } }).mock?.calls ?? [];

2828

const call = calls.at(index);

29-

expect(call, `mock call ${index + 1}`).toBeDefined();

30-

return call as Array<unknown>;

29+

if (!call) {

30+

throw new Error(`Expected mock call ${index + 1}`);

31+

}

32+

return call;

3133

}

3234
3335

function mockFirstObjectArg(mock: unknown): Record<string, unknown> {

Original file line numberDiff line numberDiff line change

@@ -68,8 +68,10 @@ function buildPluginsParams(commandBodyNormalized: string, workspaceDir: string)

6868

function mockCall(mock: unknown, index = 0): Array<unknown> {

6969

const calls = (mock as { mock?: { calls?: Array<Array<unknown>> } }).mock?.calls ?? [];

7070

const call = calls.at(index);

71-

expect(call, `mock call ${index + 1}`).toBeDefined();

72-

return call as Array<unknown>;

71+

if (!call) {

72+

throw new Error(`Expected mock call ${index + 1}`);

73+

}

74+

return call;

7375

}

7476
7577

function mockFirstObjectArg(mock: unknown): Record<string, unknown> {

Original file line numberDiff line numberDiff line change

@@ -108,8 +108,10 @@ function buildResetParams(

108108

function mockCall(mock: unknown, index = 0): Array<unknown> {

109109

const calls = (mock as { mock?: { calls?: Array<Array<unknown>> } }).mock?.calls ?? [];

110110

const call = calls.at(index);

111-

expect(call, `mock call ${index + 1}`).toBeDefined();

112-

return call as Array<unknown>;

111+

if (!call) {

112+

throw new Error(`Expected mock call ${index + 1}`);

113+

}

114+

return call;

113115

}

114116
115117

function requireRecord(value: unknown, label: string): Record<string, unknown> {

Original file line numberDiff line numberDiff line change

@@ -179,13 +179,17 @@ type SessionBindingBindInput = {

179179
180180

function firstFocusTargetSessionParams(): FocusTargetSessionParams {

181181

const firstCall = hoisted.resolveFocusTargetSessionMock.mock.calls[0];

182-

expect(firstCall).toBeDefined();

182+

if (!firstCall) {

183+

throw new Error("Expected focus target session call");

184+

}

183185

return firstCall[0] as FocusTargetSessionParams;

184186

}

185187
186188

function firstSessionBindingBindInput(): SessionBindingBindInput {

187189

const firstCall = hoisted.sessionBindingBindMock.mock.calls[0];

188-

expect(firstCall).toBeDefined();

190+

if (!firstCall) {

191+

throw new Error("Expected session binding bind call");

192+

}

189193

return firstCall[0] as SessionBindingBindInput;

190194

}

191195
Original file line numberDiff line numberDiff line change

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

43154315

expect(tailDispatchEvent?.sendPolicy).toBe("deny");

43164316

expect(tailDispatchEvent?.suppressUserDelivery).toBe(true);

43174317

expect(tailDispatchEvent?.suppressReplyLifecycle).toBe(true);

4318-

expect(tailDispatchCall?.[1]).toBeDefined();

4318+

if (tailDispatchCall?.[1] === undefined) {

4319+

throw new Error("Expected tail dispatch metadata");

4320+

}

43194321

});

43204322
43214323

it("suppresses final reply delivery when sendPolicy is deny", async () => {

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

46564658

expect(replyDispatchEvent?.suppressReplyLifecycle).toBe(false);

46574659

expect(replyDispatchEvent?.sourceReplyDeliveryMode).toBe("message_tool_only");

46584660

expect(replyDispatchEvent?.sendPolicy).toBe("allow");

4659-

expect(replyDispatchCall?.[1]).toBeDefined();

4661+

if (replyDispatchCall?.[1] === undefined) {

4662+

throw new Error("Expected reply dispatch metadata");

4663+

}

46604664

});

46614665
46624666

it("preserves hook-blocked metadata when source delivery is message-tool-only", async () => {

Original file line numberDiff line numberDiff line change

@@ -115,8 +115,10 @@ function parseInlineDirectivesForTest(body: string) {

115115
116116

function mockCallInput(mock: { mock: { calls: unknown[][] } }, index = 0): Record<string, unknown> {

117117

const call = mock.mock.calls[index];

118-

expect(call).toBeDefined();

119-

const input = call?.[0];

118+

if (!call) {

119+

throw new Error(`Expected mock call ${index}`);

120+

}

121+

const input = call[0];

120122

expect(typeof input).toBe("object");

121123

expect(input).not.toBeNull();

122124

return input as Record<string, unknown>;