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

推荐订阅源

G
Google Developers Blog
博客园 - 聂微东
J
Java Code Geeks
Engineering at Meta
Engineering at Meta
Jina AI
Jina AI
D
Docker
B
Blog
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
D
DataBreaches.Net
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Y
Y Combinator Blog
N
Netflix TechBlog - Medium
月光博客
月光博客
F
Fortinet All Blogs
爱范儿
爱范儿
H
Help Net Security
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
The Cloudflare Blog
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
U
Unit 42

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
slack: enforce reaction notification policy [AI] (#80907)...
pgondhi987 · 2026-05-12 · via Recent Commits to openclaw:main

@@ -136,6 +136,69 @@ describe("registerSlackReactionEvents", () => {

136136

},

137137

expectedCalls: 0,

138138

},

139+

{

140+

name: "blocks reactions when reaction notifications are off",

141+

input: { overrides: { dmPolicy: "open", reactionMode: "off" } },

142+

expectedCalls: 0,

143+

},

144+

{

145+

name: "blocks own-mode reactions on messages not authored by the bot",

146+

input: {

147+

overrides: { dmPolicy: "open", reactionMode: "own" },

148+

event: {

149+

...buildReactionEvent(),

150+

item_user: "U_OTHER",

151+

},

152+

},

153+

expectedCalls: 0,

154+

},

155+

{

156+

name: "allows own-mode reactions on messages authored by the bot",

157+

input: {

158+

overrides: { dmPolicy: "open", reactionMode: "own" },

159+

event: {

160+

...buildReactionEvent(),

161+

item_user: "U_BOT",

162+

},

163+

},

164+

expectedCalls: 1,

165+

},

166+

{

167+

name: "blocks reactions from senders outside the reaction allowlist",

168+

input: {

169+

overrides: {

170+

dmPolicy: "open",

171+

reactionMode: "allowlist",

172+

reactionAllowlist: ["U2"],

173+

},

174+

event: buildReactionEvent({ user: "U1" }),

175+

},

176+

expectedCalls: 0,

177+

},

178+

{

179+

name: "blocks allowlist-mode reactions when the reaction allowlist is empty",

180+

input: {

181+

overrides: {

182+

dmPolicy: "open",

183+

reactionMode: "allowlist",

184+

reactionAllowlist: [],

185+

},

186+

event: buildReactionEvent({ user: "U1" }),

187+

},

188+

expectedCalls: 0,

189+

},

190+

{

191+

name: "allows reactions from senders inside the reaction allowlist",

192+

input: {

193+

overrides: {

194+

dmPolicy: "open",

195+

reactionMode: "allowlist",

196+

reactionAllowlist: ["U1"],

197+

},

198+

event: buildReactionEvent({ user: "U1" }),

199+

},

200+

expectedCalls: 1,

201+

},

139202

];

140203141204

it.each(cases)("$name", async ({ input, expectedCalls }) => {

@@ -161,6 +224,65 @@ describe("registerSlackReactionEvents", () => {

161224

expect(trackEvent).toHaveBeenCalledTimes(1);

162225

});

163226227+

it("marks queued reaction events as untrusted external content", async () => {

228+

await executeReactionCase();

229+230+

expect(reactionQueueMock).toHaveBeenCalledWith(expect.any(String), {

231+

sessionKey: "agent:main:main",

232+

contextKey: "slack:reaction:added:D1:123.456:U1:thumbsup",

233+

trusted: false,

234+

});

235+

});

236+237+

it("drops off-mode reactions before resolving Slack context", async () => {

238+

reactionQueueMock.mockClear();

239+

const harness = createSlackSystemEventTestHarness({ reactionMode: "off" });

240+

const resolveChannelName = vi.fn(harness.ctx.resolveChannelName);

241+

const resolveUserName = vi.fn(harness.ctx.resolveUserName);

242+

harness.ctx.resolveChannelName = resolveChannelName;

243+

harness.ctx.resolveUserName = resolveUserName;

244+

registerSlackReactionEvents({ ctx: harness.ctx });

245+

const handler = requireReactionHandler(

246+

harness.getHandler("reaction_added") as ReactionHandler | null,

247+

"added",

248+

);

249+250+

await handler({

251+

event: buildReactionEvent({ user: "U777", channel: "D123" }),

252+

body: {},

253+

});

254+255+

expect(resolveChannelName).not.toHaveBeenCalled();

256+

expect(resolveUserName).not.toHaveBeenCalled();

257+

expect(reactionQueueMock).not.toHaveBeenCalled();

258+

});

259+260+

it("drops own-mode reactions on non-bot messages before resolving Slack context", async () => {

261+

reactionQueueMock.mockClear();

262+

const harness = createSlackSystemEventTestHarness({ reactionMode: "own" });

263+

const resolveChannelName = vi.fn(harness.ctx.resolveChannelName);

264+

const resolveUserName = vi.fn(harness.ctx.resolveUserName);

265+

harness.ctx.resolveChannelName = resolveChannelName;

266+

harness.ctx.resolveUserName = resolveUserName;

267+

registerSlackReactionEvents({ ctx: harness.ctx });

268+

const handler = requireReactionHandler(

269+

harness.getHandler("reaction_added") as ReactionHandler | null,

270+

"added",

271+

);

272+273+

await handler({

274+

event: {

275+

...buildReactionEvent({ user: "U777", channel: "D123" }),

276+

item_user: "U_OTHER",

277+

},

278+

body: {},

279+

});

280+281+

expect(resolveChannelName).not.toHaveBeenCalled();

282+

expect(resolveUserName).not.toHaveBeenCalled();

283+

expect(reactionQueueMock).not.toHaveBeenCalled();

284+

});

285+164286

it("passes sender context when resolving reaction session keys", async () => {

165287

reactionQueueMock.mockClear();

166288

const harness = createSlackSystemEventTestHarness();