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

推荐订阅源

D
Docker
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
Y
Y Combinator Blog
N
Netflix TechBlog - Medium
M
MIT News - Artificial intelligence
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Check Point Blog
The GitHub Blog
The GitHub Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
GbyAI
GbyAI
博客园_首页
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
aimingoo的专栏
aimingoo的专栏
T
The Blog of Author Tim Ferriss
The Cloudflare 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
enhance(slack): deliver native plugin approvals (#85062) ...
kevinslin · 2026-05-22 · via Recent Commits to openclaw:main

@@ -33,6 +33,10 @@ function readChatUpdatePayload(

3333

}

34343535

describe("slackApprovalNativeRuntime", () => {

36+

it("subscribes to plugin approval events", () => {

37+

expect(slackApprovalNativeRuntime.eventKinds).toEqual(["exec", "plugin"]);

38+

});

39+3640

it("renders only the allowed pending actions", async () => {

3741

const payload = (await slackApprovalNativeRuntime.presentation.buildPendingPayload({

3842

cfg: {} as never,

@@ -89,6 +93,81 @@ describe("slackApprovalNativeRuntime", () => {

8993

expect(JSON.stringify(payload.blocks)).not.toContain("Allow Always");

9094

});

919596+

it("renders plugin pending approvals with plugin approval actions", async () => {

97+

const payload = (await slackApprovalNativeRuntime.presentation.buildPendingPayload({

98+

cfg: {} as never,

99+

accountId: "default",

100+

context: {

101+

app: {} as never,

102+

config: {} as never,

103+

},

104+

request: {

105+

id: "plugin:req-1",

106+

request: {

107+

title: "Share screen with Computer Use",

108+

description: "Computer Use wants to inspect the desktop.",

109+

},

110+

createdAtMs: 0,

111+

expiresAtMs: 60_000,

112+

},

113+

approvalKind: "plugin",

114+

nowMs: 0,

115+

view: {

116+

approvalKind: "plugin",

117+

phase: "pending",

118+

approvalId: "plugin:req-1",

119+

title: "Share screen with Computer Use",

120+

description: "Computer Use wants to inspect the desktop.",

121+

severity: "warning",

122+

pluginId: "computer-use",

123+

toolName: "screenshot",

124+

metadata: [

125+

{ label: "Severity", value: "Warning" },

126+

{ label: "Plugin", value: "computer-use" },

127+

],

128+

actions: [

129+

{

130+

decision: "allow-once",

131+

label: "Allow Once",

132+

command: "/approve plugin:req-1 allow-once",

133+

style: "success",

134+

},

135+

{

136+

decision: "allow-always",

137+

label: "Allow Always",

138+

command: "/approve plugin:req-1 allow-always",

139+

style: "success",

140+

},

141+

{

142+

decision: "deny",

143+

label: "Deny",

144+

command: "/approve plugin:req-1 deny",

145+

style: "danger",

146+

},

147+

],

148+

expiresAtMs: 60_000,

149+

},

150+

})) as SlackPayload;

151+152+

expect(payload.text).toContain("*Plugin approval required*");

153+

expect(payload.text).toContain("Share screen with Computer Use");

154+

expect(payload.text).toContain("*Approval ID:* plugin:req-1");

155+

expect(payload.text).not.toContain("*Command*");

156+

const actionsBlock = findSlackActionsBlock(

157+

payload.blocks as Array<{ type?: string; elements?: unknown[] }>,

158+

);

159+

const labels = (actionsBlock?.elements ?? []).map((element) =>

160+

typeof element === "object" &&

161+

element &&

162+

typeof (element as { text?: { text?: unknown } }).text?.text === "string"

163+

? (element as { text: { text: string } }).text.text

164+

: "",

165+

);

166+167+

expect(labels).toEqual(["Allow Once", "Allow Always", "Deny"]);

168+

expect(JSON.stringify(payload.blocks)).toContain("plugin:req-1");

169+

});

170+92171

it("renders resolved updates without interactive blocks", async () => {

93172

const result = await slackApprovalNativeRuntime.presentation.buildResolvedResult({

94173

cfg: {} as never,

@@ -136,6 +215,101 @@ describe("slackApprovalNativeRuntime", () => {

136215

).toBe(false);

137216

});

138217218+

it("renders plugin resolved and expired updates without command text", async () => {

219+

const resolved = await slackApprovalNativeRuntime.presentation.buildResolvedResult({

220+

cfg: {} as never,

221+

accountId: "default",

222+

context: {

223+

app: {} as never,

224+

config: {} as never,

225+

},

226+

request: {

227+

id: "plugin:req-1",

228+

request: {

229+

title: "Share screen with Computer Use",

230+

description: "Computer Use wants to inspect the desktop.",

231+

},

232+

createdAtMs: 0,

233+

expiresAtMs: 60_000,

234+

},

235+

resolved: {

236+

id: "plugin:req-1",

237+

decision: "allow-once",

238+

resolvedBy: "U123APPROVER",

239+

ts: 0,

240+

} as never,

241+

view: {

242+

approvalKind: "plugin",

243+

phase: "resolved",

244+

approvalId: "plugin:req-1",

245+

title: "Share screen with Computer Use",

246+

description: "Computer Use wants to inspect the desktop.",

247+

severity: "warning",

248+

pluginId: "computer-use",

249+

toolName: "screenshot",

250+

metadata: [{ label: "Plugin", value: "computer-use" }],

251+

decision: "allow-once",

252+

resolvedBy: "U123APPROVER",

253+

},

254+

entry: {

255+

channelId: "D123APPROVER",

256+

messageTs: "1712345678.999999",

257+

},

258+

});

259+

const expired = await slackApprovalNativeRuntime.presentation.buildExpiredResult({

260+

cfg: {} as never,

261+

accountId: "default",

262+

context: {

263+

app: {} as never,

264+

config: {} as never,

265+

},

266+

request: {

267+

id: "plugin:req-1",

268+

request: {

269+

title: "Share screen with Computer Use",

270+

description: "Computer Use wants to inspect the desktop.",

271+

},

272+

createdAtMs: 0,

273+

expiresAtMs: 60_000,

274+

},

275+

view: {

276+

approvalKind: "plugin",

277+

phase: "expired",

278+

approvalId: "plugin:req-1",

279+

title: "Share screen with Computer Use",

280+

description: "Computer Use wants to inspect the desktop.",

281+

severity: "warning",

282+

pluginId: "computer-use",

283+

toolName: "screenshot",

284+

metadata: [{ label: "Plugin", value: "computer-use" }],

285+

},

286+

entry: {

287+

channelId: "D123APPROVER",

288+

messageTs: "1712345678.999999",

289+

},

290+

});

291+292+

expect(resolved.kind).toBe("update");

293+

expect(expired.kind).toBe("update");

294+

if (resolved.kind !== "update" || expired.kind !== "update") {

295+

throw new Error("expected Slack update payloads");

296+

}

297+

const resolvedPayload = resolved.payload as SlackPayload;

298+

const expiredPayload = expired.payload as SlackPayload;

299+

expect(resolvedPayload.text).toContain("*Plugin approval: Allowed once*");

300+

expect(resolvedPayload.text).toContain("Resolved by <@U123APPROVER>.");

301+

expect(resolvedPayload.text).toContain("Share screen with Computer Use");

302+

expect(resolvedPayload.text).not.toContain("*Command*");

303+

expect(expiredPayload.text).toContain("*Plugin approval expired*");

304+

expect(expiredPayload.text).toContain("Share screen with Computer Use");

305+

expect(expiredPayload.text).not.toContain("*Command*");

306+

expect(

307+

(resolvedPayload.blocks as Array<{ type?: string }>).some(

308+

(block) => block.type === "actions",

309+

),

310+

).toBe(false);

311+

});

312+139313

it("caps resolved update fallback text to Slack chat.update limits while preserving blocks", async () => {

140314

const blocks = [

141315

{