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

推荐订阅源

月光博客
月光博客
C
Check Point Blog
J
Java Code Geeks
腾讯CDC
Apple Machine Learning Research
Apple Machine Learning Research
宝玉的分享
宝玉的分享
Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
量子位
Google DeepMind News
Google DeepMind News
I
InfoQ
The GitHub Blog
The GitHub Blog
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
Hugging Face - Blog
Hugging Face - Blog
博客园 - Franky
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
小众软件
小众软件
博客园_首页
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
IT之家
IT之家

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): drop ambiguous thread replies · openclaw/open...
steipete · 2026-05-10 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

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

4747

- Slack: compile interactive reply directives for direct outbound sends without bypassing the `interactiveReplies` capability gate, preserving Block Kit for Slack CLI and cron deliveries. (#78220) Thanks @kazamak.

4848

- Slack: keep DM last-route updates scoped to the active non-main DM session, including threaded DM turns, so isolated Slack DM sessions do not overwrite the shared main route. (#73085) Thanks @clawSean.

4949

- Slack/ACP: route Slack channel and DM messages through configured ACP bindings when no runtime binding exists, keeping bound thread replies pinned to the persistent ACP session and dropping unavailable configured targets instead of falling back to `main`. (#73101) Thanks @Raasl.

50+

- Slack: mark unresolved thread replies as ambiguous and skip them instead of treating them as root channel messages, keeping thread continuation on the SDK-backed participation store. (#75630) Thanks @soichiyo.

5051

- Gateway/agents: keep structured reasons when active-run queueing fails and deprecate the legacy boolean queue helper, so steering and subagent wake diagnostics distinguish completed, non-streaming, and compacting runs. Fixes #80156. Thanks @markus-lassfolk.

5152

- Agents/UI: compact exec and tool progress rows by hiding redundant shell tool names, replacing known workspace paths with short context markers, and preserving Discord trace scrubbing for compact command lines.

5253

- ACPX: run and await the embedded ACP backend startup probe by default so the gateway `ready` signal no longer fires before the acpx runtime has either become usable or reported a probe failure; set `OPENCLAW_ACPX_RUNTIME_STARTUP_PROBE=0` to restore lazy startup. Fixes #79596. Thanks @bzelones.

Original file line numberDiff line numberDiff line change

@@ -50,12 +50,14 @@ describe("Slack missing thread_ts recovery", () => {

5050

historyResponse: { messages: [{ ts: "456" }] },

5151

});

5252

expect(message.thread_ts).toBeUndefined();

53+

expect(message._ambiguousThreadReply).toBe(true);

5354

});

5455
5556

it("continues without thread_ts when history lookup throws", async () => {

5657

const message = await runMissingThreadScenario({

5758

historyError: new Error("history failed"),

5859

});

5960

expect(message.thread_ts).toBeUndefined();

61+

expect(message._ambiguousThreadReply).toBe(true);

6062

});

6163

});

Original file line numberDiff line numberDiff line change

@@ -1213,6 +1213,32 @@ describe("slack prepareSlackMessage inbound contract", () => {

12131213

expect(replies).toHaveBeenCalledTimes(1);

12141214

});

12151215
1216+

it("drops ambiguous thread replies instead of treating them as root messages", async () => {

1217+

const { storePath } = storeFixture.makeTmpStorePath();

1218+

const cfg = {

1219+

session: { store: storePath },

1220+

channels: { slack: { enabled: true, replyToMode: "all", groupPolicy: "open" } },

1221+

} as OpenClawConfig;

1222+

const replies = vi.fn();

1223+

const slackCtx = createThreadSlackCtx({ cfg, replies });

1224+

slackCtx.resolveUserName = async () => ({ name: "Alice" });

1225+

slackCtx.resolveChannelName = async () => ({ name: "general", type: "channel" });

1226+
1227+

const prepared = await prepareMessageWith(slackCtx, createThreadAccount(), {

1228+

...createSlackMessage({

1229+

channel: "C123",

1230+

channel_type: "channel",

1231+

text: "<@B1> can you follow up?",

1232+

ts: "201.000",

1233+

parent_user_id: "U2",

1234+

}),

1235+

_ambiguousThreadReply: true,

1236+

});

1237+
1238+

expect(prepared).toBeNull();

1239+

expect(replies).not.toHaveBeenCalled();

1240+

});

1241+
12161242

it("includes thread_ts and parent_user_id metadata in thread replies", async () => {

12171243

const message = createSlackMessage({

12181244

text: "this is a reply",

Original file line numberDiff line numberDiff line change

@@ -591,6 +591,17 @@ export async function prepareSlackMessage(params: {

591591

const shouldRequireMention = isRoom

592592

? (channelConfig?.requireMention ?? ctx.defaultRequireMention)

593593

: false;

594+

if (message._ambiguousThreadReply) {

595+

ctx.logger.info(

596+

{

597+

channel: message.channel,

598+

ts: message.ts,

599+

parentUserId: message.parent_user_id,

600+

},

601+

"skipping ambiguous slack thread reply",

602+

);

603+

return null;

604+

}

594605

const canDetectMention = Boolean(ctx.botUserId) || mentionRegexes.length > 0;

595606

// Strip Slack mentions (<@U123>) before command detection so "@Labrador /new" is recognized

596607

const textForCommandDetection = stripSlackMentionsForCommandDetection(message.text ?? "");

Original file line numberDiff line numberDiff line change

@@ -26,4 +26,28 @@ describe("createSlackThreadTsResolver", () => {

2626

expect(second.thread_ts).toBe("9");

2727

expect(historyMock).toHaveBeenCalledTimes(1);

2828

});

29+
30+

it("marks cached unresolved lookups as ambiguous thread replies", async () => {

31+

const historyMock = vi.fn().mockResolvedValue({

32+

messages: [{ ts: "1" }],

33+

});

34+

const resolver = createSlackThreadTsResolver({

35+

client: { conversations: { history: historyMock } } as any,

36+

cacheTtlMs: 60_000,

37+

maxSize: 5,

38+

});

39+
40+

const message = {

41+

channel: "C1",

42+

parent_user_id: "U2",

43+

ts: "1",

44+

} as SlackMessageEvent;

45+
46+

const first = await resolver.resolve({ message, source: "message" });

47+

const second = await resolver.resolve({ message, source: "message" });

48+
49+

expect(first).toMatchObject({ _ambiguousThreadReply: true });

50+

expect(second).toMatchObject({ _ambiguousThreadReply: true });

51+

expect(historyMock).toHaveBeenCalledTimes(1);

52+

});

2953

});

Original file line numberDiff line numberDiff line change

@@ -17,6 +17,11 @@ const normalizeThreadTs = (threadTs?: string | null) => {

1717

return trimmed ? trimmed : undefined;

1818

};

1919
20+

const markAmbiguousThreadReply = (message: SlackMessageEvent): SlackMessageEvent => ({

21+

...message,

22+

_ambiguousThreadReply: true,

23+

});

24+
2025

async function resolveThreadTsFromHistory(params: {

2126

client: SlackWebClient;

2227

channelId: string;

@@ -87,7 +92,7 @@ export function createSlackThreadTsResolver(params: {

8792

const now = Date.now();

8893

const cached = getCached(cacheKey, now);

8994

if (cached !== undefined) {

90-

return cached ? { ...message, thread_ts: cached } : message;

95+

return cached ? { ...message, thread_ts: cached } : markAmbiguousThreadReply(message);

9196

}

9297
9398

if (shouldLogVerbose()) {

@@ -126,10 +131,10 @@ export function createSlackThreadTsResolver(params: {

126131
127132

if (shouldLogVerbose()) {

128133

logVerbose(

129-

`slack inbound: could not resolve missing thread_ts channel=${message.channel} ts=${message.ts}`,

134+

`slack inbound: could not resolve missing thread_ts channel=${message.channel} ts=${message.ts}; marking reply ambiguous`,

130135

);

131136

}

132-

return message;

137+

return markAmbiguousThreadReply(message);

133138

},

134139

};

135140

}

Original file line numberDiff line numberDiff line change

@@ -44,6 +44,11 @@ export type SlackMessageEvent = {

4444

blocks?: unknown[];

4545

files?: SlackFile[];

4646

attachments?: SlackAttachment[];

47+

/**

48+

* Set by the thread_ts resolver when Slack supplied parent_user_id but the

49+

* parent thread timestamp could not be recovered.

50+

*/

51+

_ambiguousThreadReply?: boolean;

4752

};

4853
4954

export type SlackAppMentionEvent = {