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

推荐订阅源

罗磊的独立博客
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园_首页
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
量子位
博客园 - 三生石上(FineUI控件)
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
V2EX
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
Jina AI
Jina AI
L
LangChain Blog
M
MIT News - Artificial intelligence
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler
WordPress大学
WordPress大学

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
fix(slack): record canonical sent thread (#95250) · openc...
bek91 · 2026-06-20 · via Recent Commits to openclaw:main

@@ -100,16 +100,44 @@ describe("sendMessageSlack thread participation", () => {

100100

clearSlackThreadParticipationCache();

101101

const client = createSlackSendTestClient();

102102103-

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

103+

const result = await sendMessageSlack("channel:C123", "hello thread", {

104104

token: "xoxb-test",

105105

cfg: SLACK_TEST_CFG,

106106

client,

107107

threadTs: "1712345678.123456",

108108

});

109109110+

expect(result.threadTs).toBe("1712345678.123456");

111+

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

110112

expect(hasSlackThreadParticipation("default", "C123", "1712345678.123456")).toBe(true);

111113

});

112114115+

it("records canonical Slack response thread participation instead of requested child thread", async () => {

116+

clearSlackThreadParticipationCache();

117+

const client = createSlackSendTestClient();

118+

client.chat.postMessage.mockResolvedValueOnce({

119+

ts: "1781932190.115869",

120+

channel: "C123",

121+

message: {

122+

ts: "1781932190.115869",

123+

thread_ts: "1781803536.235489",

124+

},

125+

});

126+127+

const result = await sendMessageSlack("channel:C123", "hello thread", {

128+

token: "xoxb-test",

129+

cfg: SLACK_TEST_CFG,

130+

client,

131+

threadTs: "1781932168.648159",

132+

});

133+134+

expect(postedMessage(client).thread_ts).toBe("1781932168.648159");

135+

expect(result.threadTs).toBe("1781803536.235489");

136+

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

137+

expect(hasSlackThreadParticipation("default", "C123", "1781803536.235489")).toBe(true);

138+

expect(hasSlackThreadParticipation("default", "C123", "1781932168.648159")).toBe(false);

139+

});

140+113141

it("does not record participation for unthreaded sends", async () => {

114142

clearSlackThreadParticipationCache();

115143

const client = createSlackSendTestClient();

@@ -174,6 +202,40 @@ describe("sendMessageSlack chunking", () => {

174202

).toStrictEqual([]);

175203

expect(postedTexts.join("")).toBe(message);

176204

});

205+206+

it("preserves the first canonical response thread across chunked sends", async () => {

207+

clearSlackThreadParticipationCache();

208+

const client = createSlackSendTestClient();

209+

client.chat.postMessage

210+

.mockResolvedValueOnce({

211+

ts: "1781932190.115869",

212+

channel: "C123",

213+

message: {

214+

ts: "1781932190.115869",

215+

thread_ts: "1781803536.235489",

216+

},

217+

})

218+

.mockResolvedValueOnce({

219+

ts: "1781932191.000000",

220+

channel: "C123",

221+

});

222+

const message = "a".repeat(8500);

223+224+

const result = await sendMessageSlack("channel:C123", message, {

225+

token: "xoxb-test",

226+

cfg: SLACK_TEST_CFG,

227+

client,

228+

threadTs: "1781932168.648159",

229+

});

230+231+

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

232+

expect(postedMessage(client).thread_ts).toBe("1781932168.648159");

233+

expect(postedMessage(client, 1).thread_ts).toBe("1781932168.648159");

234+

expect(result.threadTs).toBe("1781803536.235489");

235+

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

236+

expect(hasSlackThreadParticipation("default", "C123", "1781803536.235489")).toBe(true);

237+

expect(hasSlackThreadParticipation("default", "C123", "1781932168.648159")).toBe(false);

238+

});

177239

});

178240179241

describe("sendMessageSlack blocks", () => {

@@ -202,6 +264,34 @@ describe("sendMessageSlack blocks", () => {

202264

expect((receiptPart?.raw as Record<string, unknown> | undefined)?.channelId).toBe("C123");

203265

});

204266267+

it("uses canonical Slack response thread for block receipts and participation", async () => {

268+

clearSlackThreadParticipationCache();

269+

const client = createSlackSendTestClient();

270+

client.chat.postMessage.mockResolvedValueOnce({

271+

ts: "1781932190.115869",

272+

channel: "C123",

273+

message: {

274+

ts: "1781932190.115869",

275+

thread_ts: "1781803536.235489",

276+

},

277+

});

278+279+

const result = await sendMessageSlack("channel:C123", "", {

280+

token: "xoxb-test",

281+

cfg: SLACK_TEST_CFG,

282+

client,

283+

threadTs: "1781932168.648159",

284+

blocks: [{ type: "divider" }],

285+

});

286+287+

expect(postedMessage(client).thread_ts).toBe("1781932168.648159");

288+

expect(result.threadTs).toBe("1781803536.235489");

289+

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

290+

expect(result.receipt.parts[0]?.kind).toBe("card");

291+

expect(hasSlackThreadParticipation("default", "C123", "1781803536.235489")).toBe(true);

292+

expect(hasSlackThreadParticipation("default", "C123", "1781932168.648159")).toBe(false);

293+

});

294+205295

it("posts user-target block messages directly without conversations.open", async () => {

206296

const client = createSlackSendTestClient();

207297

client.conversations.open.mockRejectedValueOnce(new Error("missing_scope"));