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

推荐订阅源

博客园 - Franky
有赞技术团队
有赞技术团队
宝玉的分享
宝玉的分享
雷峰网
雷峰网
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
大猫的无限游戏
大猫的无限游戏
博客园 - 司徒正美
D
Docker
T
The Blog of Author Tim Ferriss
罗磊的独立博客
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
J
Java Code Geeks
Jina AI
Jina AI
博客园 - 【当耐特】
C
Check Point Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio 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): honor focused thread bindings · openclaw/open...
steipete · 2026-04-23 · via Recent Commits to openclaw:main

@@ -15,6 +15,10 @@ import {

1515

import { resolveControlCommandGate } from "openclaw/plugin-sdk/command-auth";

1616

import { hasControlCommand } from "openclaw/plugin-sdk/command-auth";

1717

import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-auth";

18+

import {

19+

resolveRuntimeConversationBindingRoute,

20+

type RuntimeConversationBindingRouteResult,

21+

} from "openclaw/plugin-sdk/conversation-runtime";

1822

import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";

1923

import { enqueueSystemEvent } from "openclaw/plugin-sdk/infra-runtime";

2024

import {

@@ -106,6 +110,7 @@ type SlackAuthorizationContext = {

106110107111

type SlackRoutingContext = {

108112

route: ReturnType<typeof resolveAgentRoute>;

113+

runtimeBinding: RuntimeConversationBindingRouteResult["bindingRecord"];

109114

chatType: "direct" | "group" | "channel";

110115

replyToMode: ReturnType<typeof resolveSlackReplyToMode>;

111116

threadContext: ReturnType<typeof resolveSlackThreadContext>;

@@ -116,6 +121,15 @@ type SlackRoutingContext = {

116121

historyKey: string;

117122

};

118123124+

function resolveSlackBaseConversationId(params: {

125+

message: SlackMessageEvent;

126+

isDirectMessage: boolean;

127+

}): string {

128+

return params.isDirectMessage

129+

? `user:${params.message.user ?? "unknown"}`

130+

: params.message.channel;

131+

}

132+119133

async function resolveSlackConversationContext(params: {

120134

ctx: SlackMonitorContext;

121135

account: ResolvedSlackAccount;

@@ -272,7 +286,7 @@ function resolveSlackRoutingContext(params: {

272286

isRoomish: boolean;

273287

}): SlackRoutingContext {

274288

const { ctx, account, message, isDirectMessage, isGroupDm, isRoom, isRoomish } = params;

275-

const route = resolveAgentRoute({

289+

let route = resolveAgentRoute({

276290

cfg: ctx.cfg,

277291

channel: "slack",

278292

accountId: account.accountId,

@@ -302,17 +316,45 @@ function resolveSlackRoutingContext(params: {

302316

// isolated sessions per message (regression from #10686).

303317

const roomThreadId = isThreadReply && threadTs ? threadTs : undefined;

304318

const canonicalThreadId = isRoomish ? roomThreadId : isThreadReply ? threadTs : autoThreadId;

305-

const threadKeys = resolveThreadSessionKeys({

306-

baseSessionKey: route.sessionKey,

307-

threadId: canonicalThreadId,

308-

parentSessionKey: canonicalThreadId && ctx.threadInheritParent ? route.sessionKey : undefined,

309-

});

319+

const baseConversationId = resolveSlackBaseConversationId({ message, isDirectMessage });

320+

const boundThreadRoute = canonicalThreadId

321+

? resolveRuntimeConversationBindingRoute({

322+

route,

323+

conversation: {

324+

channel: "slack",

325+

accountId: account.accountId,

326+

conversationId: canonicalThreadId,

327+

parentConversationId: baseConversationId,

328+

},

329+

})

330+

: null;

331+

const runtimeRoute =

332+

boundThreadRoute?.boundSessionKey || boundThreadRoute?.bindingRecord

333+

? boundThreadRoute

334+

: resolveRuntimeConversationBindingRoute({

335+

route,

336+

conversation: {

337+

channel: "slack",

338+

accountId: account.accountId,

339+

conversationId: baseConversationId,

340+

},

341+

});

342+

route = runtimeRoute.route;

343+

const threadKeys = runtimeRoute.boundSessionKey

344+

? { sessionKey: route.sessionKey, parentSessionKey: undefined }

345+

: resolveThreadSessionKeys({

346+

baseSessionKey: route.sessionKey,

347+

threadId: canonicalThreadId,

348+

parentSessionKey:

349+

canonicalThreadId && ctx.threadInheritParent ? route.sessionKey : undefined,

350+

});

310351

const sessionKey = threadKeys.sessionKey;

311352

const historyKey =

312353

isThreadReply && ctx.threadHistoryScope === "thread" ? sessionKey : message.channel;

313354314355

return {

315356

route,

357+

runtimeBinding: runtimeRoute.bindingRecord,

316358

chatType,

317359

replyToMode,

318360

threadContext,

@@ -364,6 +406,7 @@ export async function prepareSlackMessage(params: {

364406

});

365407

const {

366408

route,

409+

runtimeBinding,

367410

replyToMode,

368411

threadContext,

369412

threadTs,

@@ -372,6 +415,11 @@ export async function prepareSlackMessage(params: {

372415

sessionKey,

373416

historyKey,

374417

} = routing;

418+

if (runtimeBinding && shouldLogVerbose()) {

419+

logVerbose(

420+

`slack: routed via bound conversation ${runtimeBinding.conversation.conversationId} -> ${runtimeBinding.targetSessionKey}`,

421+

);

422+

}

375423376424

const mentionRegexes = resolveCachedMentionRegexes(ctx, route.agentId);

377425

const hasAnyMention = /<@[^>]+>/.test(message.text ?? "");