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

推荐订阅源

G
Google Developers Blog
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
人人都是产品经理
人人都是产品经理
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 【当耐特】
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
博客园 - 叶小钗
罗磊的独立博客
宝玉的分享
宝玉的分享
月光博客
月光博客
V
V2EX
博客园 - 司徒正美
Vercel News
Vercel News
量子位
Y
Y Combinator Blog
美团技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
博客园 - Franky
小众软件
小众软件
I
InfoQ
A
About on SuperTechFans

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
feat(slack): support reply broadcasts · openclaw/openclaw...
steipete · 2026-05-10 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -9,6 +9,7 @@ Docs: https://docs.openclaw.ai

99

- Agents: trim default system prompt guidance and send-only message tool schemas to reduce prompt tokens while preserving GPT-5 personality guidance.

1010

- Context: add `/context map` to send a treemap image of the current session context contributors. (#79867)

1111

- Slack: add `unfurlLinks` and `unfurlMedia` config for bot `chat.postMessage` replies, including per-account overrides, so Slack link and media previews can be suppressed without workspace-wide settings. Fixes #48435. (#80145) Thanks @esegev1 and @HemantSudarshan.

12+

- Slack: add explicit `replyBroadcast` support for text and Block Kit thread replies so agents can opt into Slack's parent-channel `reply_broadcast` behavior. (#64365) Thanks @tony88331.

1213

- Plugin SDK: deprecate public subpaths that existed for at least one month and have no bundled extension production imports, keep legacy barrel/test/zod subpath package exports for backwards compatibility, and track both sets in the SDK surface report.

1314

- Plugin SDK: deprecate public subpaths currently used by only one or two bundled plugin owners, keeping them importable while steering new plugin code to focused shared SDK seams or plugin-owned APIs.

1415

- Plugin SDK: remove the owner-specific `provider-auth-login` public subpath after moving Chutes, GitHub Copilot, and OpenAI Codex auth flows back to provider-owned modules.

Original file line numberDiff line numberDiff line change

@@ -946,6 +946,8 @@ Manual reply tags are supported:

946946

- `[[reply_to_current]]`

947947

- `[[reply_to:<id>]]`

948948
949+

For explicit Slack thread replies from the `message` tool, set `replyBroadcast: true` with `action: "send"` and `threadId` or `replyTo` to ask Slack to also broadcast the thread reply to the parent channel. This maps to Slack's `chat.postMessage` `reply_broadcast` flag and is only supported for text or Block Kit sends, not media uploads.

950+
949951

<Note>

950952

`replyToMode="off"` disables **all** reply threading in Slack, including explicit `[[reply_to_*]]` tags. This differs from Telegram, where explicit tags are still honored in `"off"` mode. Slack threads hide messages from the channel while Telegram replies stay visible inline.

951953

</Note>

Original file line numberDiff line numberDiff line change

@@ -252,6 +252,27 @@ describe("handleSlackAction", () => {

252252

});

253253

});

254254
255+

it("passes replyBroadcast to sendSlackMessage for thread replies", async () => {

256+

const cfg = slackConfig();

257+

await handleSlackAction(

258+

{

259+

action: "sendMessage",

260+

to: "channel:C123",

261+

content: "Hello thread",

262+

threadTs: "1234567890.123456",

263+

replyBroadcast: true,

264+

},

265+

cfg,

266+

);

267+

expectSlackSendCall(0, "channel:C123", "Hello thread", {

268+

cfg,

269+

mediaUrl: undefined,

270+

threadTs: "1234567890.123456",

271+

replyBroadcast: true,

272+

blocks: undefined,

273+

});

274+

});

275+
255276

it("returns a friendly error when downloadFile cannot fetch the attachment", async () => {

256277

downloadSlackFile.mockResolvedValueOnce(null);

257278

const result = await handleSlackAction(

@@ -436,6 +457,21 @@ describe("handleSlackAction", () => {

436457

});

437458

});

438459
460+

it("rejects replyBroadcast for uploadFile", async () => {

461+

await expect(

462+

handleSlackAction(

463+

{

464+

action: "uploadFile",

465+

to: "channel:C123",

466+

filePath: "/tmp/report.txt",

467+

threadTs: "111.222",

468+

replyBroadcast: true,

469+

},

470+

slackConfig(),

471+

),

472+

).rejects.toThrow(/replyBroadcast is only supported for text or block thread replies/i);

473+

});

474+
439475

it("sends media before a separate blocks message", async () => {

440476

sendSlackMessage.mockResolvedValueOnce({ channelId: "C123" });

441477

sendSlackMessage.mockResolvedValueOnce({ channelId: "C123" });

Original file line numberDiff line numberDiff line change

@@ -1,4 +1,5 @@

11

import type { AgentToolResult } from "@mariozechner/pi-agent-core";

2+

import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";

23

import { isSingleUseReplyToMode } from "openclaw/plugin-sdk/reply-reference";

34

import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";

45

import { parseSlackBlocksInput } from "./blocks-input.js";

@@ -239,9 +240,15 @@ export async function handleSlackAction(

239240

});

240241

const mediaUrl = readStringParam(params, "mediaUrl");

241242

const blocks = readSlackBlocksParam(params);

243+

const replyBroadcast = readBooleanParam(params, "replyBroadcast");

242244

if (!content && !mediaUrl && !blocks) {

243245

throw new Error("Slack sendMessage requires content, blocks, or mediaUrl.");

244246

}

247+

if (replyBroadcast && mediaUrl) {

248+

throw new Error(

249+

"Slack replyBroadcast is only supported for text or block thread replies.",

250+

);

251+

}

245252

const threadTs = resolveThreadTsFromContext(

246253

readStringParam(params, "threadTs"),

247254

to,

@@ -252,6 +259,7 @@ export async function handleSlackAction(

252259

mediaLocalRoots: context?.mediaLocalRoots,

253260

mediaReadFile: context?.mediaReadFile,

254261

threadTs: threadTs ?? undefined,

262+

...(replyBroadcast ? { replyBroadcast } : {}),

255263

};

256264

const result =

257265

mediaUrl && blocks

@@ -293,6 +301,12 @@ export async function handleSlackAction(

293301

});

294302

const filename = readStringParam(params, "filename");

295303

const title = readStringParam(params, "title");

304+

const replyBroadcast = readBooleanParam(params, "replyBroadcast");

305+

if (replyBroadcast) {

306+

throw new Error(

307+

"Slack replyBroadcast is only supported for text or block thread replies.",

308+

);

309+

}

296310

const threadTs = resolveThreadTsFromContext(

297311

readStringParam(params, "threadTs"),

298312

to,

Original file line numberDiff line numberDiff line change

@@ -207,6 +207,7 @@ export async function sendSlackMessage(

207207

mediaLocalRoots?: readonly string[];

208208

mediaReadFile?: (filePath: string) => Promise<Buffer>;

209209

threadTs?: string;

210+

replyBroadcast?: boolean;

210211

uploadFileName?: string;

211212

uploadTitle?: string;

212213

blocks?: (Block | KnownBlock)[];

@@ -222,6 +223,7 @@ export async function sendSlackMessage(

222223

mediaReadFile: opts.mediaReadFile,

223224

client: opts.client,

224225

threadTs: opts.threadTs,

226+

replyBroadcast: opts.replyBroadcast,

225227

...(opts.uploadFileName ? { uploadFileName: opts.uploadFileName } : {}),

226228

...(opts.uploadTitle ? { uploadTitle: opts.uploadTitle } : {}),

227229

blocks: opts.blocks,

Original file line numberDiff line numberDiff line change

@@ -153,6 +153,38 @@ describe("handleSlackMessageAction", () => {

153153

expectForwardedCfg(invoke, cfg);

154154

});

155155
156+

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

157+

const invoke = createInvokeSpy();

158+

const cfg = slackConfig();

159+
160+

await handleSlackMessageAction({

161+

providerId: "slack",

162+

ctx: {

163+

action: "send",

164+

cfg,

165+

params: {

166+

to: "channel:C1",

167+

message: "Visible from the channel",

168+

threadId: "111.222",

169+

replyBroadcast: true,

170+

},

171+

} as never,

172+

invoke: invoke as never,

173+

});

174+
175+

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+

);

186+

});

187+
156188

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

157189

const invoke = createInvokeSpy();

158190

const cfg = slackConfig();

@@ -190,6 +222,25 @@ describe("handleSlackMessageAction", () => {

190222

expectForwardedCfg(invoke, cfg);

191223

});

192224
225+

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

226+

await expect(

227+

handleSlackMessageAction({

228+

providerId: "slack",

229+

ctx: {

230+

action: "upload-file",

231+

cfg: {},

232+

params: {

233+

to: "channel:C1",

234+

filePath: "/tmp/report.png",

235+

threadId: "111.222",

236+

replyBroadcast: true,

237+

},

238+

} as never,

239+

invoke: createInvokeSpy() as never,

240+

}),

241+

).rejects.toThrow(/replyBroadcast is only supported for text or block thread replies/i);

242+

});

243+
193244

it("maps upload-file aliases to upload params", async () => {

194245

const invoke = createInvokeSpy();

195246

const cfg = slackConfig();

Original file line numberDiff line numberDiff line change

@@ -1,4 +1,5 @@

11

import type { AgentToolResult } from "@mariozechner/pi-agent-core";

2+

import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";

23

import type { ChannelMessageActionContext } from "openclaw/plugin-sdk/channel-contract";

34

import {

45

normalizeInteractiveReply,

@@ -58,6 +59,10 @@ export async function handleSlackMessageAction(params: {

5859

if (!content && !mediaUrl && !blocks) {

5960

throw new Error("Slack send requires message, blocks, or media.");

6061

}

62+

const replyBroadcast = readBooleanParam(actionParams, "replyBroadcast");

63+

if (replyBroadcast && mediaUrl) {

64+

throw new Error("Slack replyBroadcast is only supported for text or block thread replies.");

65+

}

6166

const threadId = readStringParam(actionParams, "threadId");

6267

const replyTo = readStringParam(actionParams, "replyTo");

6368

return await invoke(

@@ -68,6 +73,7 @@ export async function handleSlackMessageAction(params: {

6873

mediaUrl: mediaUrl ?? undefined,

6974

accountId,

7075

threadTs: threadId ?? replyTo ?? undefined,

76+

...(replyBroadcast ? { replyBroadcast } : {}),

7177

...(blocks ? { blocks } : {}),

7278

},

7379

cfg,

@@ -219,6 +225,10 @@ export async function handleSlackMessageAction(params: {

219225

}

220226
221227

if (action === "upload-file") {

228+

const replyBroadcast = readBooleanParam(actionParams, "replyBroadcast");

229+

if (replyBroadcast) {

230+

throw new Error("Slack replyBroadcast is only supported for text or block thread replies.");

231+

}

222232

const to = readStringParam(actionParams, "to") ?? resolveChannelId();

223233

const filePath =

224234

readStringParam(actionParams, "filePath", { trim: false }) ??

Original file line numberDiff line numberDiff line change

@@ -30,6 +30,17 @@ function createSlackMessageIdActionSchema(): Record<string, TSchema> {

3030

};

3131

}

3232
33+

function createSlackSendActionSchema(): Record<string, TSchema> {

34+

return {

35+

replyBroadcast: Type.Optional(

36+

Type.Boolean({

37+

description:

38+

'Slack-only opt-in for action="send" thread replies. Set true with threadId or replyTo on text/block sends to also broadcast the reply to the parent channel. Not supported for media or upload-file.',

39+

}),

40+

),

41+

};

42+

}

43+
3344

export function describeSlackMessageTool({

3445

cfg,

3546

accountId,

@@ -51,6 +62,12 @@ export function describeSlackMessageTool({

5162

actions: ["download-file"],

5263

});

5364

}

65+

if (actions.includes("send")) {

66+

schema.push({

67+

properties: createSlackSendActionSchema(),

68+

actions: ["send"],

69+

});

70+

}

5471

const messageIdActions: ChannelMessageActionName[] = [];

5572

for (const action of SLACK_MESSAGE_ID_ACTIONS) {

5673

if (actions.includes(action)) {

Original file line numberDiff line numberDiff line change

@@ -172,6 +172,25 @@ describe("Slack message tools", () => {

172172

expect(alias.description).toMatch(/Alias for messageId/i);

173173

});

174174
175+

it("describes Slack reply broadcasts as send-only thread hints", () => {

176+

const discovery = describeSlackMessageTool({

177+

cfg: {

178+

channels: {

179+

slack: {

180+

botToken: "xoxb-test",

181+

},

182+

},

183+

},

184+

});

185+
186+

const { schema, property } = requireSchemaProperty(discovery, "replyBroadcast");

187+
188+

expect(schema.actions).toEqual(["send"]);

189+

expect(property.description).toContain('action="send"');

190+

expect(property.description).toContain("threadId");

191+

expect(property.description).toContain("Not supported for media or upload-file");

192+

});

193+
175194

it("omits Slack file and message id schemas when those actions are disabled", () => {

176195

const discovery = describeSlackMessageTool({

177196

cfg: {

@@ -191,6 +210,13 @@ describe("Slack message tools", () => {

191210

});

192211
193212

expect(discovery.actions).toEqual(["send"]);

194-

expect(discovery.schema).toBeNull();

213+

const schemas = Array.isArray(discovery.schema)

214+

? discovery.schema

215+

: discovery.schema

216+

? [discovery.schema]

217+

: [];

218+

expect(schemas.some((entry) => "fileId" in entry.properties)).toBe(false);

219+

expect(schemas.some((entry) => "messageId" in entry.properties)).toBe(false);

220+

expect(schemas.some((entry) => "replyBroadcast" in entry.properties)).toBe(true);

195221

});

196222

});

Original file line numberDiff line numberDiff line change

@@ -254,6 +254,44 @@ describe("sendMessageSlack blocks", () => {

254254

expect(result.receipt.threadId).toBe("171234.100");

255255

});

256256
257+

it("passes reply_broadcast for threaded text sends only on the first chunk", async () => {

258+

const client = createSlackSendTestClient();

259+
260+

await sendMessageSlack("channel:C123", "a".repeat(8500), {

261+

token: "xoxb-test",

262+

cfg: SLACK_TEST_CFG,

263+

client,

264+

threadTs: "171234.100",

265+

replyBroadcast: true,

266+

});

267+
268+

expect(client.chat.postMessage).toHaveBeenCalledTimes(2);

269+

expect(client.chat.postMessage.mock.calls[0]?.[0]).toEqual(

270+

expect.objectContaining({

271+

thread_ts: "171234.100",

272+

reply_broadcast: true,

273+

}),

274+

);

275+

expect(client.chat.postMessage.mock.calls[1]?.[0]).not.toHaveProperty("reply_broadcast");

276+

});

277+
278+

it("does not pass reply_broadcast when no thread is selected", async () => {

279+

const client = createSlackSendTestClient();

280+
281+

await sendMessageSlack("channel:C123", "hello", {

282+

token: "xoxb-test",

283+

cfg: SLACK_TEST_CFG,

284+

client,

285+

replyBroadcast: true,

286+

});

287+
288+

expect(client.chat.postMessage).toHaveBeenCalledWith(

289+

expect.not.objectContaining({

290+

reply_broadcast: true,

291+

}),

292+

);

293+

});

294+
257295

it("does not retry Slack platform errors", async () => {

258296

const client = createSlackSendTestClient();

259297

const platformError = Object.assign(

@@ -375,6 +413,21 @@ describe("sendMessageSlack blocks", () => {

375413

expect(client.chat.postMessage).not.toHaveBeenCalled();

376414

});

377415
416+

it("rejects replyBroadcast combined with mediaUrl", async () => {

417+

const client = createSlackSendTestClient();

418+

await expect(

419+

sendMessageSlack("channel:C123", "hi", {

420+

token: "xoxb-test",

421+

cfg: SLACK_TEST_CFG,

422+

client,

423+

mediaUrl: "https://example.com/image.png",

424+

threadTs: "171234.100",

425+

replyBroadcast: true,

426+

}),

427+

).rejects.toThrow(/replyBroadcast is only supported for text or block thread replies/i);

428+

expect(client.chat.postMessage).not.toHaveBeenCalled();

429+

});

430+
378431

it("rejects empty blocks arrays from runtime callers", async () => {

379432

const client = createSlackSendTestClient();

380433

await expect(