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

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Recent Announcements
Recent Announcements
V
Visual Studio Blog
博客园 - 叶小钗
H
Help Net Security
aimingoo的专栏
aimingoo的专栏
宝玉的分享
宝玉的分享
U
Unit 42
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Fortinet All Blogs
V
V2EX
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
D
DataBreaches.Net
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
A
About on SuperTechFans
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
C
Check Point Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
M
MIT News - Artificial intelligence

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 resumed sends in thread (#77620) · opencl...
bek91 · 2026-05-05 · via Recent Commits to openclaw:main

@@ -4,12 +4,14 @@ import type { ChannelMessageCapability } from "../../channels/plugins/message-ca

44

import type { ChannelMessageActionName, ChannelPlugin } from "../../channels/plugins/types.js";

55

import type { MessageActionRunResult } from "../../infra/outbound/message-action-runner.js";

66

type CreateMessageTool = typeof import("./message-tool.js").createMessageTool;

7+

type CreateOpenClawTools = typeof import("../openclaw-tools.js").createOpenClawTools;

78

type ResetPluginRuntimeStateForTest =

89

typeof import("../../plugins/runtime.js").resetPluginRuntimeStateForTest;

910

type SetActivePluginRegistry = typeof import("../../plugins/runtime.js").setActivePluginRegistry;

1011

type CreateTestRegistry = typeof import("../../test-utils/channel-plugins.js").createTestRegistry;

11121213

let createMessageTool: CreateMessageTool;

14+

let createOpenClawTools: CreateOpenClawTools;

1315

let resetPluginRuntimeStateForTest: ResetPluginRuntimeStateForTest;

1416

let setActivePluginRegistry: SetActivePluginRegistry;

1517

let createTestRegistry: CreateTestRegistry;

@@ -154,6 +156,7 @@ beforeAll(async () => {

154156

await import("../../plugins/runtime.js"));

155157

({ createTestRegistry } = await import("../../test-utils/channel-plugins.js"));

156158

({ createMessageTool } = await import("./message-tool.js"));

159+

({ createOpenClawTools } = await import("../openclaw-tools.js"));

157160

});

158161159162

beforeEach(() => {

@@ -358,6 +361,79 @@ describe("message tool agent routing", () => {

358361

expect(call?.agentId).toBe("alpha");

359362

expect(call?.sessionKey).toBe("agent:alpha:main");

360363

});

364+365+

it("uses agentThreadId as ambient thread context when currentThreadTs is absent", async () => {

366+

mockSendResult({ channel: "slack", to: "channel:C123" });

367+368+

const tool = createMessageTool({

369+

agentSessionKey: "agent:main:slack:channel:c123:thread:111.222",

370+

config: {} as never,

371+

currentChannelProvider: "slack",

372+

currentChannelId: "channel:C123",

373+

agentThreadId: "111.222",

374+

runMessageAction: mocks.runMessageAction as never,

375+

});

376+377+

await tool.execute("1", {

378+

action: "send",

379+

channel: "slack",

380+

message: "stay in thread",

381+

});

382+383+

const call = mocks.runMessageAction.mock.calls[0]?.[0];

384+

expect(call?.toolContext?.currentThreadTs).toBe("111.222");

385+

expect(call?.toolContext?.replyToMode).toBe("all");

386+

});

387+388+

it("keeps explicit reply mode opt-out when agentThreadId is present", async () => {

389+

mockSendResult({ channel: "slack", to: "channel:C123" });

390+391+

const tool = createMessageTool({

392+

agentSessionKey: "agent:main:slack:channel:c123:thread:111.222",

393+

config: {} as never,

394+

currentChannelProvider: "slack",

395+

currentChannelId: "channel:C123",

396+

agentThreadId: "111.222",

397+

replyToMode: "off",

398+

runMessageAction: mocks.runMessageAction as never,

399+

});

400+401+

await tool.execute("1", {

402+

action: "send",

403+

channel: "slack",

404+

message: "send at channel level",

405+

});

406+407+

const call = mocks.runMessageAction.mock.calls[0]?.[0];

408+

expect(call?.toolContext?.currentThreadTs).toBe("111.222");

409+

expect(call?.toolContext?.replyToMode).toBe("off");

410+

});

411+412+

it("forwards agentThreadId through createOpenClawTools to the message tool", async () => {

413+

mockSendResult({ channel: "slack", to: "channel:C123" });

414+415+

const tool = createOpenClawTools({

416+

agentSessionKey: "agent:main:slack:channel:c123:thread:111.222",

417+

config: {} as never,

418+

agentChannel: "slack",

419+

currentChannelId: "channel:C123",

420+

agentThreadId: "111.222",

421+

}).find((candidate) => candidate.name === "message");

422+423+

if (!tool) {

424+

throw new Error("message tool not found");

425+

}

426+427+

await tool.execute("1", {

428+

action: "send",

429+

channel: "slack",

430+

message: "stay in thread",

431+

});

432+433+

const call = mocks.runMessageAction.mock.calls[0]?.[0];

434+

expect(call?.toolContext?.currentThreadTs).toBe("111.222");

435+

expect(call?.toolContext?.replyToMode).toBe("all");

436+

});

361437

});

362438363439

describe("message tool explicit target guard", () => {