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

推荐订阅源

SecWiki News
SecWiki News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
博客园 - 叶小钗
S
SegmentFault 最新的问题
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
博客园_首页
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
腾讯CDC
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
L
Lohrmann on Cybersecurity
量子位
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tor Project blog
J
Java Code Geeks
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
博客园 - 三生石上(FineUI控件)
Attack and Defense Labs
Attack and Defense Labs
AI
AI
The Cloudflare Blog
T
Tailwind CSS Blog
S
Schneier on Security
爱范儿
爱范儿
PCI Perspectives
PCI Perspectives
Stack Overflow Blog
Stack Overflow Blog
S
Secure Thoughts
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
The Exploit Database - CXSecurity.com
博客园 - 【当耐特】
V2EX - 技术
V2EX - 技术
S
Securelist
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
Help Net Security
Help Net Security
C
Cisco Blogs
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
K
Kaspersky official blog
T
The Blog of Author Tim Ferriss
G
Google Developers Blog
S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Simon Willison's Weblog
Simon Willison's Weblog

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: clear slack message action broad matchers · openclaw/openclaw@22d979f
steipete · 2026-05-11 · via Recent Commits to openclaw:main

@@ -16,6 +16,32 @@ function expectForwardedCfg(invoke: ReturnType<typeof createInvokeSpy>, cfg: unk

1616

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

1717

}

181819+

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

20+

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

21+

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

22+

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

23+

}

24+

return action;

25+

}

26+27+

function blockAt(action: Record<string, unknown>, index: number) {

28+

const blocks = action.blocks as Array<Record<string, unknown>> | undefined;

29+

const block = blocks?.[index];

30+

if (!block) {

31+

throw new Error(`expected Slack block ${index}`);

32+

}

33+

return block;

34+

}

35+36+

function elementAt(block: Record<string, unknown>, index: number) {

37+

const elements = block.elements as Array<Record<string, unknown>> | undefined;

38+

const element = elements?.[index];

39+

if (!element) {

40+

throw new Error(`expected Slack block element ${index}`);

41+

}

42+

return element;

43+

}

44+1945

describe("handleSlackMessageAction", () => {

2046

it("merges presentation and interactive blocks when sending", async () => {

2147

const invoke = createInvokeSpy();

@@ -44,16 +70,11 @@ describe("handleSlackMessageAction", () => {

4470

invoke: invoke as never,

4571

});

467247-

const action = invoke.mock.calls[0]?.[0] as {

48-

blocks?: Array<{ type?: string; elements?: Array<{ value?: string }> }>;

49-

};

50-

expect(action.blocks).toEqual([

51-

expect.objectContaining({ type: "section" }),

52-

expect.objectContaining({

53-

type: "actions",

54-

elements: [expect.objectContaining({ value: "approve" })],

55-

}),

56-

]);

73+

const action = firstAction(invoke);

74+

expect(blockAt(action, 0).type).toBe("section");

75+

const actionsBlock = blockAt(action, 1);

76+

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

77+

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

5778

});

58795980

it("keeps generated Slack control ids unique when presentation and interactive controls are merged", async () => {

@@ -88,23 +109,13 @@ describe("handleSlackMessageAction", () => {

88109

invoke: invoke as never,

89110

});

9011191-

const action = invoke.mock.calls[0]?.[0] as {

92-

blocks?: Array<{

93-

block_id?: string;

94-

elements?: Array<{ action_id?: string; value?: string }>;

95-

}>;

96-

};

97-98-

expect(action.blocks).toEqual([

99-

expect.objectContaining({

100-

block_id: "openclaw_reply_buttons_1",

101-

elements: [expect.objectContaining({ action_id: "openclaw:reply_button:1:1" })],

102-

}),

103-

expect.objectContaining({

104-

block_id: "openclaw_reply_buttons_2",

105-

elements: [expect.objectContaining({ action_id: "openclaw:reply_button:2:1" })],

106-

}),

107-

]);

112+

const action = firstAction(invoke);

113+

const firstButtons = blockAt(action, 0);

114+

expect(firstButtons.block_id).toBe("openclaw_reply_buttons_1");

115+

expect(elementAt(firstButtons, 0).action_id).toBe("openclaw:reply_button:1:1");

116+

const secondButtons = blockAt(action, 1);

117+

expect(secondButtons.block_id).toBe("openclaw_reply_buttons_2");

118+

expect(elementAt(secondButtons, 0).action_id).toBe("openclaw:reply_button:2:1");

108119

});

109120110121

it("passes media and rendered interactive blocks through for split Slack delivery", async () => {

@@ -134,23 +145,16 @@ describe("handleSlackMessageAction", () => {

134145

});

135146136147

expect(invoke).toHaveBeenCalledOnce();

137-

expect(invoke).toHaveBeenCalledWith(

138-

expect.objectContaining({

139-

action: "sendMessage",

140-

to: "channel:C1",

141-

content: "Approval required",

142-

mediaUrl: "https://example.com/report.md",

143-

blocks: [

144-

expect.objectContaining({

145-

type: "actions",

146-

elements: [expect.objectContaining({ value: "approve" })],

147-

}),

148-

],

149-

}),

150-

cfg,

151-

undefined,

152-

);

148+

const action = firstAction(invoke);

149+

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

150+

expect(action.to).toBe("channel:C1");

151+

expect(action.content).toBe("Approval required");

152+

expect(action.mediaUrl).toBe("https://example.com/report.md");

153+

const actionsBlock = blockAt(action, 0);

154+

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

155+

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

153156

expectForwardedCfg(invoke, cfg);

157+

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

154158

});

155159156160

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

@@ -172,17 +176,14 @@ describe("handleSlackMessageAction", () => {

172176

invoke: invoke as never,

173177

});

174178175-

expect(invoke).toHaveBeenCalledWith(

176-

expect.objectContaining({

177-

action: "sendMessage",

178-

to: "channel:C1",

179-

content: "Visible from the channel",

180-

threadTs: "111.222",

181-

replyBroadcast: true,

182-

}),

183-

cfg,

184-

undefined,

185-

);

179+

const action = firstAction(invoke);

180+

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

181+

expect(action.to).toBe("channel:C1");

182+

expect(action.content).toBe("Visible from the channel");

183+

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

184+

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

185+

expectForwardedCfg(invoke, cfg);

186+

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

186187

});

187188188189

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

@@ -203,17 +204,14 @@ describe("handleSlackMessageAction", () => {

203204

invoke: invoke as never,

204205

});

205206206-

expect(invoke).toHaveBeenCalledWith(

207-

expect.objectContaining({

208-

action: "sendMessage",

209-

to: "channel:C1",

210-

content: "Visible in the parent channel",

211-

threadTs: undefined,

212-

topLevel: true,

213-

}),

214-

cfg,

215-

undefined,

216-

);

207+

const action = firstAction(invoke);

208+

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

209+

expect(action.to).toBe("channel:C1");

210+

expect(action.content).toBe("Visible in the parent channel");

211+

expect(action.threadTs).toBeUndefined();

212+

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

213+

expectForwardedCfg(invoke, cfg);

214+

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

217215

});

218216219217

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

@@ -234,15 +232,12 @@ describe("handleSlackMessageAction", () => {

234232

invoke: invoke as never,

235233

});

236234237-

expect(invoke).toHaveBeenCalledWith(

238-

expect.objectContaining({

239-

action: "sendMessage",

240-

threadTs: undefined,

241-

topLevel: true,

242-

}),

243-

cfg,

244-

undefined,

245-

);

235+

const action = firstAction(invoke);

236+

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

237+

expect(action.threadTs).toBeUndefined();

238+

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

239+

expectForwardedCfg(invoke, cfg);

240+

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

246241

});

247242248243

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

@@ -266,20 +261,16 @@ describe("handleSlackMessageAction", () => {

266261

invoke: invoke as never,

267262

});

268263269-

expect(invoke).toHaveBeenCalledWith(

270-

expect.objectContaining({

271-

action: "uploadFile",

272-

to: "user:U1",

273-

filePath: "/tmp/report.png",

274-

initialComment: "fresh build",

275-

filename: "build.png",

276-

title: "Build Screenshot",

277-

threadTs: "111.222",

278-

}),

279-

cfg,

280-

undefined,

281-

);

264+

const action = firstAction(invoke);

265+

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

266+

expect(action.to).toBe("user:U1");

267+

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

268+

expect(action.initialComment).toBe("fresh build");

269+

expect(action.filename).toBe("build.png");

270+

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

271+

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

282272

expectForwardedCfg(invoke, cfg);

273+

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

283274

});

284275285276

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

@@ -320,18 +311,14 @@ describe("handleSlackMessageAction", () => {

320311

invoke: invoke as never,

321312

});

322313323-

expect(invoke).toHaveBeenCalledWith(

324-

expect.objectContaining({

325-

action: "uploadFile",

326-

to: "C1",

327-

filePath: "/tmp/chart.png",

328-

initialComment: "chart attached",

329-

threadTs: "333.444",

330-

}),

331-

cfg,

332-

undefined,

333-

);

314+

const action = firstAction(invoke);

315+

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

316+

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

317+

expect(action.filePath).toBe("/tmp/chart.png");

318+

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

319+

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

334320

expectForwardedCfg(invoke, cfg);

321+

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

335322

});

336323337324

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

@@ -352,17 +339,13 @@ describe("handleSlackMessageAction", () => {

352339

invoke: invoke as never,

353340

});

354341355-

expect(invoke).toHaveBeenCalledWith(

356-

expect.objectContaining({

357-

action: "uploadFile",

358-

to: "channel:C1",

359-

filePath: "/tmp/report.txt",

360-

initialComment: "path alias",

361-

}),

362-

cfg,

363-

undefined,

364-

);

342+

const action = firstAction(invoke);

343+

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

344+

expect(action.to).toBe("channel:C1");

345+

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

346+

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

365347

expectForwardedCfg(invoke, cfg);

348+

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

366349

});

367350368351

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

@@ -381,14 +364,11 @@ describe("handleSlackMessageAction", () => {

381364

invoke: invoke as never,

382365

});

383366384-

expect(invoke).toHaveBeenCalledWith(

385-

expect.objectContaining({

386-

action: "readMessages",

387-

channelId: "C1",

388-

messageId: "1712345678.654321",

389-

}),

390-

{},

391-

);

367+

const action = firstAction(invoke);

368+

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

369+

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

370+

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

371+

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

392372

});

393373394374

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

@@ -425,15 +405,11 @@ describe("handleSlackMessageAction", () => {

425405

invoke: invoke as never,

426406

});

427407428-

expect(invoke).toHaveBeenCalledWith(

429-

expect.objectContaining({

430-

action: "downloadFile",

431-

fileId: "F123",

432-

channelId: "C1",

433-

threadId: "111.222",

434-

}),

435-

cfg,

436-

);

408+

const action = firstAction(invoke);

409+

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

410+

expect(action.fileId).toBe("F123");

411+

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

412+

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

437413

expectForwardedCfg(invoke, cfg);

438414

});

439415

@@ -455,15 +431,11 @@ describe("handleSlackMessageAction", () => {

455431

invoke: invoke as never,

456432

});

457433458-

expect(invoke).toHaveBeenCalledWith(

459-

expect.objectContaining({

460-

action: "downloadFile",

461-

fileId: "F999",

462-

channelId: "channel:C2",

463-

threadId: "333.444",

464-

}),

465-

cfg,

466-

);

434+

const action = firstAction(invoke);

435+

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

436+

expect(action.fileId).toBe("F999");

437+

expect(action.channelId).toBe("channel:C2");

438+

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

467439

expectForwardedCfg(invoke, cfg);

468440

});

469441