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

推荐订阅源

J
Java Code Geeks
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
A
About on SuperTechFans
Vercel News
Vercel News
B
Blog
Martin Fowler
Martin Fowler
MyScale Blog
MyScale Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
D
Docker
V
Visual Studio Blog
博客园 - 叶小钗
The Cloudflare Blog
Jina AI
Jina AI
B
Blog RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
WordPress大学
WordPress大学
T
Tailwind CSS Blog
MongoDB | Blog
MongoDB | Blog
D
DataBreaches.Net
月光博客
月光博客
大猫的无限游戏
大猫的无限游戏

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
AGT-80 AGT-81 Fix Discord ingress ack ordering (#93407) ·...
mgunnin · 2026-06-16 · via Recent Commits to openclaw:main

@@ -126,15 +126,65 @@ describe("maybeCreateDiscordAutoThread", () => {

126126127127

it("creates auto-thread if channelType is GuildText", async () => {

128128

postMock.mockResolvedValueOnce({ id: "thread1" });

129+

getMock.mockResolvedValueOnce({});

129130

const result = await maybeCreateDiscordAutoThread(createBaseParams());

130131

expect(result).toBe("thread1");

131132

expect(postMock).toHaveBeenCalled();

132133

});

134+135+

it("reuses an existing message thread before creating a new one", async () => {

136+

getMock.mockResolvedValueOnce({ thread: { id: "existing-thread" } });

137+

const result = await maybeCreateDiscordAutoThread(createBaseParams());

138+139+

expect(result).toBe("existing-thread");

140+

expect(postMock).not.toHaveBeenCalled();

141+

});

142+143+

it("reuses an existing message thread before skipping bot-authored messages", async () => {

144+

getMock.mockResolvedValueOnce({ thread: { id: "existing-thread" } });

145+

const result = await maybeCreateDiscordAutoThread(

146+

createBaseParams({

147+

message: {

148+

...mockMessage,

149+

author: { bot: true },

150+

} as Parameters<MaybeCreateDiscordAutoThreadFn>[0]["message"],

151+

}),

152+

);

153+154+

expect(result).toBe("existing-thread");

155+

expect(postMock).not.toHaveBeenCalled();

156+

});

157+158+

it("skips creating new auto-threads for bot-authored messages", async () => {

159+

getMock.mockResolvedValueOnce({});

160+

const result = await maybeCreateDiscordAutoThread(

161+

createBaseParams({

162+

message: {

163+

...mockMessage,

164+

author: { bot: true },

165+

} as Parameters<MaybeCreateDiscordAutoThreadFn>[0]["message"],

166+

}),

167+

);

168+169+

expect(result).toBeUndefined();

170+

expect(postMock).not.toHaveBeenCalled();

171+

});

172+173+

it("still creates an auto-thread when the existing-thread lookup fails", async () => {

174+

getMock.mockRejectedValueOnce(new Error("transient fetch failure"));

175+

postMock.mockResolvedValueOnce({ id: "thread1" });

176+177+

const result = await maybeCreateDiscordAutoThread(createBaseParams());

178+179+

expect(result).toBe("thread1");

180+

expect(postMock).toHaveBeenCalled();

181+

});

133182

});

134183135184

describe("maybeCreateDiscordAutoThread autoArchiveDuration", () => {

136185

it("uses configured autoArchiveDuration", async () => {

137186

postMock.mockResolvedValueOnce({ id: "thread1" });

187+

getMock.mockResolvedValueOnce({});

138188

await maybeCreateDiscordAutoThread(

139189

createBaseParams({

140190

channelConfig: { allowed: true, autoThread: true, autoArchiveDuration: "10080" },

@@ -145,6 +195,7 @@ describe("maybeCreateDiscordAutoThread autoArchiveDuration", () => {

145195146196

it("accepts numeric autoArchiveDuration", async () => {

147197

postMock.mockResolvedValueOnce({ id: "thread1" });

198+

getMock.mockResolvedValueOnce({});

148199

await maybeCreateDiscordAutoThread(

149200

createBaseParams({

150201

channelConfig: { allowed: true, autoThread: true, autoArchiveDuration: 4320 },

@@ -155,6 +206,7 @@ describe("maybeCreateDiscordAutoThread autoArchiveDuration", () => {

155206156207

it("defaults to 60 when autoArchiveDuration not set", async () => {

157208

postMock.mockResolvedValueOnce({ id: "thread1" });

209+

getMock.mockResolvedValueOnce({});

158210

await maybeCreateDiscordAutoThread(createBaseParams());

159211

expectRestBodyField(postMock, "auto_archive_duration", 60);

160212

});

@@ -163,6 +215,7 @@ describe("maybeCreateDiscordAutoThread autoArchiveDuration", () => {

163215

describe("maybeCreateDiscordAutoThread autoThreadName", () => {

164216

it("renames created thread when generated mode is enabled", async () => {

165217

postMock.mockResolvedValueOnce({ id: "thread1" });

218+

getMock.mockResolvedValueOnce({});

166219

patchMock.mockResolvedValueOnce({});

167220

generateThreadTitleMock.mockResolvedValueOnce("Deploy rollout summary");

168221

@@ -193,6 +246,7 @@ describe("maybeCreateDiscordAutoThread autoThreadName", () => {

193246194247

it("does not block thread creation while title summary is pending", async () => {

195248

postMock.mockResolvedValueOnce({ id: "thread1" });

249+

getMock.mockResolvedValueOnce({});

196250

patchMock.mockResolvedValueOnce({});

197251

let resolveTitle: ((value: string | null) => void) | undefined;

198252

generateThreadTitleMock.mockReturnValueOnce(

@@ -219,6 +273,7 @@ describe("maybeCreateDiscordAutoThread autoThreadName", () => {

219273220274

it("uses channel-specific thread override for generated title model", async () => {

221275

postMock.mockResolvedValueOnce({ id: "thread1" });

276+

getMock.mockResolvedValueOnce({});

222277

patchMock.mockResolvedValueOnce({});

223278

generateThreadTitleMock.mockResolvedValueOnce("Deploy rollout summary");

224279

@@ -248,6 +303,7 @@ describe("maybeCreateDiscordAutoThread autoThreadName", () => {

248303249304

it("falls back to parent channel override for generated title model", async () => {

250305

postMock.mockResolvedValueOnce({ id: "thread1" });

306+

getMock.mockResolvedValueOnce({});

251307

patchMock.mockResolvedValueOnce({});

252308

generateThreadTitleMock.mockResolvedValueOnce("Deploy rollout summary");

253309

@@ -277,6 +333,7 @@ describe("maybeCreateDiscordAutoThread autoThreadName", () => {

277333278334

it("skips summarization when cfg or agentId is missing", async () => {

279335

postMock.mockResolvedValueOnce({ id: "thread1" });

336+

getMock.mockResolvedValueOnce({});

280337

await maybeCreateDiscordAutoThread(

281338

createBaseParams({

282339

channelConfig: { allowed: true, autoThread: true, autoThreadName: "generated" },

@@ -289,6 +346,7 @@ describe("maybeCreateDiscordAutoThread autoThreadName", () => {

289346290347

it("does not rename when autoThreadName is not set", async () => {

291348

postMock.mockResolvedValueOnce({ id: "thread1" });

349+

getMock.mockResolvedValueOnce({});

292350

await maybeCreateDiscordAutoThread(

293351

createBaseParams({

294352

channelConfig: { allowed: true, autoThread: true },

@@ -301,6 +359,7 @@ describe("maybeCreateDiscordAutoThread autoThreadName", () => {

301359302360

it("does not rename when generated title sanitizes to fallback thread name", async () => {

303361

postMock.mockResolvedValueOnce({ id: "thread1" });

362+

getMock.mockResolvedValueOnce({});

304363

generateThreadTitleMock.mockResolvedValueOnce("<@123456789012345678> <#987654321098765432>");

305364306365

const cfg = { agents: { defaults: { model: "anthropic/claude-opus-4-6" } } } as OpenClawConfig;