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

推荐订阅源

V
Visual Studio Blog
Recent Announcements
Recent Announcements
雷峰网
雷峰网
The GitHub Blog
The GitHub Blog
罗磊的独立博客
月光博客
月光博客
J
Java Code Geeks
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Fortinet All Blogs
U
Unit 42
C
Check Point Blog
Martin Fowler
Martin Fowler
有赞技术团队
有赞技术团队
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
MyScale Blog
MyScale 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
fix(slack): keep DM thread turns out of active steering ·...
guanbear · 2026-05-31 · via Recent Commits to openclaw:main

@@ -1135,6 +1135,126 @@ describe("dispatchReplyFromConfig", () => {

11351135

expect(dispatcher.sendFinalReply).toHaveBeenCalledTimes(1);

11361136

});

113711371138+

it("records routed Slack thread id on dispatch-owned reply operations", async () => {

1139+

setNoAbort();

1140+

const cfg = emptyConfig;

1141+

const dispatcher = createDispatcher();

1142+

const ctx = buildTestCtx({

1143+

Provider: "slack",

1144+

Surface: "slack",

1145+

OriginatingChannel: "slack",

1146+

OriginatingTo: "user:U1",

1147+

ChatType: "direct",

1148+

SessionKey: "agent:main:slack:direct:U1",

1149+

MessageThreadId: "501.000",

1150+

});

1151+

const replyResolver = vi.fn(async (_ctx: MsgContext, opts?: GetReplyOptions) => {

1152+

const operation = (

1153+

opts as { replyOperation?: { routeThreadId?: string | number } } | undefined

1154+

)?.replyOperation;

1155+

expect(operation?.routeThreadId).toBe("501.000");

1156+

return { text: "hi" } satisfies ReplyPayload;

1157+

});

1158+1159+

await dispatchReplyFromConfig({ ctx, cfg, dispatcher, replyResolver });

1160+1161+

expect(replyResolver).toHaveBeenCalledTimes(1);

1162+

});

1163+1164+

it("lets a different Slack DM routed thread reach reply resolution while another thread is active", async () => {

1165+

setNoAbort();

1166+

const sessionKey = "agent:main:slack:direct:U1";

1167+

const activeOperation = createReplyOperation({

1168+

sessionKey,

1169+

sessionId: "active-session",

1170+

resetTriggered: false,

1171+

routeThreadId: "500.000",

1172+

});

1173+

activeOperation.setPhase("running");

1174+

const dispatcher = createDispatcher();

1175+

const replyResolver = vi.fn(async () => ({ text: "thread B reply" }) satisfies ReplyPayload);

1176+1177+

try {

1178+

const resultPromise = dispatchReplyFromConfig({

1179+

ctx: buildTestCtx({

1180+

Provider: "slack",

1181+

Surface: "slack",

1182+

OriginatingChannel: "slack",

1183+

OriginatingTo: "user:U1",

1184+

ChatType: "direct",

1185+

SessionKey: sessionKey,

1186+

MessageThreadId: "501.000",

1187+

BodyForAgent: "second top-level DM",

1188+

}),

1189+

cfg: emptyConfig,

1190+

dispatcher,

1191+

replyResolver,

1192+

});

1193+1194+

const result = await Promise.race([

1195+

resultPromise,

1196+

new Promise<"timed-out">((resolve) => setTimeout(() => resolve("timed-out"), 1_000)),

1197+

]);

1198+

if (result === "timed-out") {

1199+

activeOperation.complete();

1200+

await resultPromise;

1201+

throw new Error("Slack routed thread was blocked by the active reply operation");

1202+

}

1203+1204+

expect(result).toMatchObject({

1205+

queuedFinal: true,

1206+

counts: { tool: 0, block: 0, final: 0 },

1207+

});

1208+

expect(replyResolver).toHaveBeenCalledTimes(1);

1209+

expect(dispatcher.sendFinalReply).toHaveBeenCalledTimes(1);

1210+

} finally {

1211+

activeOperation.complete();

1212+

}

1213+

});

1214+1215+

it("keeps non-Slack routed direct turns behind the active reply operation", async () => {

1216+

setNoAbort();

1217+

const sessionKey = "agent:main:telegram:direct:1";

1218+

const activeOperation = createReplyOperation({

1219+

sessionKey,

1220+

sessionId: "active-session",

1221+

resetTriggered: false,

1222+

routeThreadId: "500.000",

1223+

});

1224+

activeOperation.setPhase("running");

1225+

const dispatcher = createDispatcher();

1226+

const replyResolver = vi.fn(async () => ({ text: "telegram reply" }) satisfies ReplyPayload);

1227+1228+

const resultPromise = dispatchReplyFromConfig({

1229+

ctx: buildTestCtx({

1230+

Provider: "telegram",

1231+

Surface: "telegram",

1232+

OriginatingChannel: "telegram",

1233+

OriginatingTo: "user:1",

1234+

ChatType: "direct",

1235+

SessionKey: sessionKey,

1236+

MessageThreadId: "501.000",

1237+

BodyForAgent: "second telegram direct turn",

1238+

}),

1239+

cfg: emptyConfig,

1240+

dispatcher,

1241+

replyResolver,

1242+

});

1243+1244+

try {

1245+

const result = await Promise.race([

1246+

resultPromise,

1247+

new Promise<"blocked">((resolve) => setTimeout(() => resolve("blocked"), 1_000)),

1248+

]);

1249+1250+

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

1251+

expect(replyResolver).not.toHaveBeenCalled();

1252+

} finally {

1253+

activeOperation.complete();

1254+

await resultPromise;

1255+

}

1256+

});

1257+11381258

it("routes when OriginatingChannel differs from Provider", async () => {

11391259

setNoAbort();

11401260

mocks.routeReply.mockClear();