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

推荐订阅源

美团技术团队
J
Java Code Geeks
有赞技术团队
有赞技术团队
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
G
Google Developers Blog
月光博客
月光博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
S
SegmentFault 最新的问题
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
腾讯CDC
V
Visual Studio Blog
博客园 - 【当耐特】
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
L
LangChain 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: dedupe gateway hook run mock calls · openclaw/openc...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -89,6 +89,25 @@ async function waitForCronIsolatedRuns(count: number, timeoutMs = 2_000): Promis

8989

.toBe(count);

9090

}

919192+

type HookCronRunCall = {

93+

sessionKey?: string;

94+

job?: {

95+

agentId?: string;

96+

payload?: {

97+

externalContentSource?: string;

98+

model?: string;

99+

};

100+

};

101+

};

102+103+

function cronRunCall(index = 0): HookCronRunCall {

104+

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

105+

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

106+

throw new Error(`expected cron isolated run call ${index + 1}`);

107+

}

108+

return call as HookCronRunCall;

109+

}

110+92111

async function postAgentHookWithIdempotency(

93112

port: number,

94113

idempotencyKey: string,

@@ -133,9 +152,7 @@ async function expectHookAgentSessionRouting(params: {

133152

expect(resAgent.status).toBe(200);

134153

await waitForSystemEventTexts(HOOKS_MAIN_SESSION_KEY);

135154136-

const routedCall = (cronIsolatedRun.mock.calls[0] as unknown[] | undefined)?.[0] as

137-

| { sessionKey?: string; job?: { agentId?: string } }

138-

| undefined;

155+

const routedCall = cronRunCall();

139156

expect(routedCall?.job?.agentId).toBe("hooks");

140157

expect(routedCall?.sessionKey).toBe(params.expectedSessionKey);

141158

drainSystemEvents(HOOKS_MAIN_SESSION_KEY);

@@ -180,9 +197,7 @@ describe("gateway server hooks", () => {

180197

expect(resAgent.status).toBe(200);

181198

const agentEvents = await waitForSystemEvent();

182199

expect(agentEvents.some((event) => event.includes("Hook Email: done"))).toBe(true);

183-

const firstCall = (cronIsolatedRun.mock.calls[0] as unknown[] | undefined)?.[0] as {

184-

job?: { payload?: { externalContentSource?: string } };

185-

};

200+

const firstCall = cronRunCall();

186201

expect(firstCall?.job?.payload?.externalContentSource).toBe("webhook");

187202

drainSystemEvents(resolveMainKey());

188203

@@ -194,9 +209,7 @@ describe("gateway server hooks", () => {

194209

});

195210

expect(resAgentModel.status).toBe(200);

196211

await waitForSystemEvent();

197-

const call = (cronIsolatedRun.mock.calls[0] as unknown[] | undefined)?.[0] as {

198-

job?: { payload?: { model?: string } };

199-

};

212+

const call = cronRunCall();

200213

expect(call?.job?.payload?.model).toBe("openai/gpt-4.1-mini");

201214

drainSystemEvents(resolveMainKey());

202215

@@ -208,9 +221,7 @@ describe("gateway server hooks", () => {

208221

});

209222

expect(resAgentWithId.status).toBe(200);

210223

await waitForSystemEventTexts(HOOKS_MAIN_SESSION_KEY);

211-

const routedCall = (cronIsolatedRun.mock.calls[0] as unknown[] | undefined)?.[0] as {

212-

job?: { agentId?: string };

213-

};

224+

const routedCall = cronRunCall();

214225

expect(routedCall?.job?.agentId).toBe("hooks");

215226

drainSystemEvents(HOOKS_MAIN_SESSION_KEY);

216227

@@ -222,9 +233,7 @@ describe("gateway server hooks", () => {

222233

});

223234

expect(resAgentUnknown.status).toBe(200);

224235

await waitForSystemEvent();

225-

const fallbackCall = (cronIsolatedRun.mock.calls[0] as unknown[] | undefined)?.[0] as {

226-

job?: { agentId?: string };

227-

};

236+

const fallbackCall = cronRunCall();

228237

expect(fallbackCall?.job?.agentId).toBe("main");

229238

drainSystemEvents(resolveMainKey());

230239

@@ -297,10 +306,7 @@ describe("gateway server hooks", () => {

297306

.poll(() => cronIsolatedRun.mock.calls.length, { timeout: 2_000, interval: 10 })

298307

.toBe(1);

299308300-

const call = (cronIsolatedRun.mock.calls[0] as unknown[] | undefined)?.[0] as {

301-

sessionKey?: string;

302-

job?: { payload?: { externalContentSource?: string } };

303-

};

309+

const call = cronRunCall();

304310

expect(call?.sessionKey).toBe("main");

305311

expect(call?.job?.payload?.externalContentSource).toBe("gmail");

306312

drainSystemEvents(resolveMainKey());

@@ -490,9 +496,7 @@ describe("gateway server hooks", () => {

490496

});

491497

expect(defaultRoute.status).toBe(200);

492498

await waitForSystemEvent();

493-

const defaultCall = (cronIsolatedRun.mock.calls[0] as unknown[] | undefined)?.[0] as

494-

| { sessionKey?: string }

495-

| undefined;

499+

const defaultCall = cronRunCall();

496500

expect(defaultCall?.sessionKey).toBe("hook:ingress");

497501

drainSystemEvents(resolveMainKey());

498502

@@ -508,9 +512,7 @@ describe("gateway server hooks", () => {

508512

});

509513

expect(mappedOk.status).toBe(200);

510514

await waitForSystemEvent();

511-

const mappedCall = (cronIsolatedRun.mock.calls[0] as unknown[] | undefined)?.[0] as

512-

| { sessionKey?: string }

513-

| undefined;

515+

const mappedCall = cronRunCall();

514516

expect(mappedCall?.sessionKey).toBe("hook:mapped:42");

515517

drainSystemEvents(resolveMainKey());

516518

@@ -562,9 +564,7 @@ describe("gateway server hooks", () => {

562564

});

563565

expect(staticMapped.status).toBe(200);

564566

await waitForSystemEvent();

565-

const staticCall = (cronIsolatedRun.mock.calls[0] as unknown[] | undefined)?.[0] as

566-

| { sessionKey?: string }

567-

| undefined;

567+

const staticCall = cronRunCall();

568568

expect(staticCall?.sessionKey).toBe("hook:gmail:fixed");

569569

drainSystemEvents(resolveMainKey());

570570

});

@@ -812,9 +812,7 @@ describe("gateway server hooks", () => {

812812

const resNoAgent = await postHook(port, "/hooks/agent", { message: "No explicit agent" });

813813

expect(resNoAgent.status).toBe(200);

814814

await waitForSystemEvent();

815-

const noAgentCall = (cronIsolatedRun.mock.calls[0] as unknown[] | undefined)?.[0] as {

816-

job?: { agentId?: string };

817-

};

815+

const noAgentCall = cronRunCall();

818816

expect(noAgentCall?.job?.agentId).toBeUndefined();

819817

drainSystemEvents(resolveMainKey());

820818

@@ -825,9 +823,7 @@ describe("gateway server hooks", () => {

825823

});

826824

expect(resAllowed.status).toBe(200);

827825

await waitForSystemEventTexts(HOOKS_MAIN_SESSION_KEY);

828-

const allowedCall = (cronIsolatedRun.mock.calls[0] as unknown[] | undefined)?.[0] as {

829-

job?: { agentId?: string };

830-

};

826+

const allowedCall = cronRunCall();

831827

expect(allowedCall?.job?.agentId).toBe("hooks");

832828

drainSystemEvents(HOOKS_MAIN_SESSION_KEY);

833829