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

推荐订阅源

Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
量子位
博客园 - 叶小钗
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
IT之家
IT之家
S
SegmentFault 最新的问题
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
雷峰网
雷峰网
博客园 - 聂微东
美团技术团队
Last Week in AI
Last Week in AI
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园_首页
V
Visual Studio Blog
大猫的无限游戏
大猫的无限游戏
The Cloudflare 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(mattermost): keep message tool replies in threads (#9...
amknight · 2026-06-16 · via Recent Commits to openclaw:main

@@ -74,6 +74,14 @@ function requireMattermostReplyToModeResolver() {

7474

return resolveReplyToMode;

7575

}

767677+

function requireMattermostThreadTargetMatcher() {

78+

const matchesToolContextTarget = mattermostPlugin.threading?.matchesToolContextTarget;

79+

if (!matchesToolContextTarget) {

80+

throw new Error("mattermost threading.matchesToolContextTarget missing");

81+

}

82+

return matchesToolContextTarget;

83+

}

84+7785

function requireMattermostSendText() {

7886

const sendText = mattermostPlugin.outbound?.sendText;

7987

if (!sendText) {

@@ -236,6 +244,27 @@ describe("mattermostPlugin", () => {

236244

},

237245

);

238246247+

it("matches bare Mattermost channel ids against the active channel target", () => {

248+

const matchesToolContextTarget = requireMattermostThreadTargetMatcher();

249+250+

expect(

251+

matchesToolContextTarget({

252+

target: "tqfek9psh7fw8mpa5berwyytqw",

253+

toolContext: {

254+

currentChannelId: "channel:tqfek9psh7fw8mpa5berwyytqw",

255+

},

256+

}),

257+

).toBe(true);

258+

expect(

259+

matchesToolContextTarget({

260+

target: "tqfek9psh7fw8mpa5berwyytqw",

261+

toolContext: {

262+

currentChannelId: "channel:kqfek9psh7fw8mpa5berwyytqw",

263+

},

264+

}),

265+

).toBe(false);

266+

});

267+239268

it("exposes the effective reply root as the transport thread", () => {

240269

const resolveReplyTransport = mattermostPlugin.threading?.resolveReplyTransport;

241270

if (!resolveReplyTransport) {

@@ -249,8 +278,30 @@ describe("mattermostPlugin", () => {

249278

threadId: "other-thread",

250279

}),

251280

).toEqual({

252-

replyToId: "post-parent",

253-

threadId: "post-parent",

281+

replyToId: "other-thread",

282+

threadId: "other-thread",

283+

});

284+

expect(

285+

resolveReplyTransport({

286+

cfg: {},

287+

replyToId: "child-post",

288+

replyToIsExplicit: true,

289+

threadId: "root-post",

290+

}),

291+

).toEqual({

292+

replyToId: "root-post",

293+

threadId: "root-post",

294+

});

295+

expect(

296+

resolveReplyTransport({

297+

cfg: {},

298+

replyToId: "child-post",

299+

replyToIsExplicit: false,

300+

threadId: "root-post",

301+

}),

302+

).toEqual({

303+

replyToId: "root-post",

304+

threadId: "root-post",

254305

});

255306

expect(

256307

resolveReplyTransport({

@@ -402,6 +453,17 @@ describe("mattermostPlugin", () => {

402453

},

403454

}),

404455

).toBeUndefined();

456+

expect(

457+

resolveAutoThreadId({

458+

cfg: {},

459+

to: "tqfek9psh7fw8mpa5berwyytqw",

460+

toolContext: {

461+

currentChannelId: "channel:tqfek9psh7fw8mpa5berwyytqw",

462+

currentThreadTs: "root-1",

463+

replyToMode: "all",

464+

},

465+

}),

466+

).toBe("root-1");

405467

expect(

406468

resolveAutoThreadId({

407469

cfg: {},

@@ -714,7 +776,28 @@ describe("mattermostPlugin", () => {

714776

expect(options.replyToId).toBe("post-root");

715777

});

716778717-

it("keeps explicit reply precedence when threadId is also provided", async () => {

779+

it("uses threadId as the Mattermost root when generic replyTo names a child post", async () => {

780+

const cfg = createMattermostTestConfig();

781+782+

await mattermostPlugin.actions?.handleAction?.(

783+

createMattermostActionContext({

784+

action: "send",

785+

params: {

786+

to: "channel:CHAN1",

787+

message: "hello",

788+

threadId: "post-root",

789+

replyTo: "child-post",

790+

},

791+

cfg,

792+

accountId: "default",

793+

}),

794+

);

795+796+

const options = expectSingleMattermostSend("channel:CHAN1", "hello");

797+

expect(options.replyToId).toBe("post-root");

798+

});

799+800+

it("keeps explicit replyToId precedence when threadId is also provided", async () => {

718801

const cfg = createMattermostTestConfig();

719802720803

await mattermostPlugin.actions?.handleAction?.(

@@ -723,6 +806,7 @@ describe("mattermostPlugin", () => {

723806

params: {

724807

to: "channel:CHAN1",

725808

message: "hello",

809+

replyToId: "explicit-root",

726810

threadId: "post-root",

727811

replyTo: "child-post",

728812

},

@@ -732,7 +816,7 @@ describe("mattermostPlugin", () => {

732816

);

733817734818

const options = expectSingleMattermostSend("channel:CHAN1", "hello");

735-

expect(options.replyToId).toBe("child-post");

819+

expect(options.replyToId).toBe("explicit-root");

736820

});

737821738822

it("routes filePath send actions through Mattermost media upload options", async () => {