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

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
GbyAI
GbyAI
aimingoo的专栏
aimingoo的专栏
L
LangChain Blog
I
InfoQ
D
Docker
F
Fortinet All Blogs
Y
Y Combinator Blog
Martin Fowler
Martin Fowler
月光博客
月光博客
B
Blog
Engineering at Meta
Engineering at Meta
T
Tailwind CSS Blog
罗磊的独立博客
博客园_首页
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
IT之家
IT之家
V
V2EX

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 slack dispatch mock calls · openclaw/openclaw...
steipete · 2026-05-12 · via Recent Commits to openclaw:main

@@ -12,12 +12,24 @@ function slackConfig() {

1212

return { channels: { slack: { botToken: "tok" } } };

1313

}

141415+

function firstInvokeCall(invoke: ReturnType<typeof createInvokeSpy>) {

16+

const [call] = invoke.mock.calls;

17+

if (!call) {

18+

throw new Error("expected first Slack action invoke");

19+

}

20+

return call;

21+

}

22+1523

function expectForwardedCfg(invoke: ReturnType<typeof createInvokeSpy>, cfg: unknown) {

16-

expect(invoke.mock.calls[0]?.[1]).toBe(cfg);

24+

expect(firstInvokeCall(invoke)[1]).toBe(cfg);

25+

}

26+27+

function expectNoForwardedToolContext(invoke: ReturnType<typeof createInvokeSpy>) {

28+

expect(firstInvokeCall(invoke)[2]).toBeUndefined();

1729

}

18301931

function firstAction(invoke: ReturnType<typeof createInvokeSpy>) {

20-

const action = invoke.mock.calls[0]?.[0];

32+

const action = firstInvokeCall(invoke)[0];

2133

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

2234

throw new Error("expected first invoke action");

2335

}

@@ -154,7 +166,7 @@ describe("handleSlackMessageAction", () => {

154166

expect(actionsBlock.type).toBe("actions");

155167

expect(elementAt(actionsBlock, 0).value).toBe("approve");

156168

expectForwardedCfg(invoke, cfg);

157-

expect(invoke.mock.calls[0]?.[2]).toBeUndefined();

169+

expectNoForwardedToolContext(invoke);

158170

});

159171160172

it("passes replyBroadcast through for Slack thread sends", async () => {

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

183195

expect(action.threadTs).toBe("111.222");

184196

expect(action.replyBroadcast).toBe(true);

185197

expectForwardedCfg(invoke, cfg);

186-

expect(invoke.mock.calls[0]?.[2]).toBeUndefined();

198+

expectNoForwardedToolContext(invoke);

187199

});

188200189201

it("passes topLevel through so same-channel Slack sends can suppress thread inheritance", async () => {

@@ -211,7 +223,7 @@ describe("handleSlackMessageAction", () => {

211223

expect(action.threadTs).toBeUndefined();

212224

expect(action.topLevel).toBe(true);

213225

expectForwardedCfg(invoke, cfg);

214-

expect(invoke.mock.calls[0]?.[2]).toBeUndefined();

226+

expectNoForwardedToolContext(invoke);

215227

});

216228217229

it("treats threadId null as a Slack top-level send request", async () => {

@@ -237,7 +249,7 @@ describe("handleSlackMessageAction", () => {

237249

expect(action.threadTs).toBeUndefined();

238250

expect(action.topLevel).toBe(true);

239251

expectForwardedCfg(invoke, cfg);

240-

expect(invoke.mock.calls[0]?.[2]).toBeUndefined();

252+

expectNoForwardedToolContext(invoke);

241253

});

242254243255

it("maps upload-file to the internal uploadFile action", async () => {

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

270282

expect(action.title).toBe("Build Screenshot");

271283

expect(action.threadTs).toBe("111.222");

272284

expectForwardedCfg(invoke, cfg);

273-

expect(invoke.mock.calls[0]?.[2]).toBeUndefined();

285+

expectNoForwardedToolContext(invoke);

274286

});

275287276288

it("rejects replyBroadcast for upload-file", async () => {

@@ -318,7 +330,7 @@ describe("handleSlackMessageAction", () => {

318330

expect(action.initialComment).toBe("chart attached");

319331

expect(action.threadTs).toBe("333.444");

320332

expectForwardedCfg(invoke, cfg);

321-

expect(invoke.mock.calls[0]?.[2]).toBeUndefined();

333+

expectNoForwardedToolContext(invoke);

322334

});

323335324336

it("maps upload-file path alias to filePath", async () => {

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

345357

expect(action.filePath).toBe("/tmp/report.txt");

346358

expect(action.initialComment).toBe("path alias");

347359

expectForwardedCfg(invoke, cfg);

348-

expect(invoke.mock.calls[0]?.[2]).toBeUndefined();

360+

expectNoForwardedToolContext(invoke);

349361

});

350362351363

it("forwards messageId for read actions", async () => {

@@ -368,7 +380,7 @@ describe("handleSlackMessageAction", () => {

368380

expect(action.action).toBe("readMessages");

369381

expect(action.channelId).toBe("C1");

370382

expect(action.messageId).toBe("1712345678.654321");

371-

expect(invoke.mock.calls[0]?.[1]).toEqual({});

383+

expect(firstInvokeCall(invoke)[1]).toEqual({});

372384

});

373385374386

it("requires filePath, path, or media for upload-file", async () => {