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

推荐订阅源

WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
GbyAI
GbyAI
B
Blog
F
Fortinet All Blogs
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
Google Developers Blog
A
About on SuperTechFans
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
MyScale Blog
MyScale Blog
B
Blog RSS Feed

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 block replies in first thread · openclaw...
steipete · 2026-04-25 · via Recent Commits to openclaw:main

@@ -51,6 +51,7 @@ import {

5151

createSlackReplyDeliveryPlan,

5252

deliverReplies,

5353

readSlackReplyBlocks,

54+

resolveDeliveredSlackReplyThreadTs,

5455

resolveSlackThreadTs,

5556

} from "../replies.js";

5657

import { createReplyDispatcherWithTyping, dispatchInboundMessage } from "../reply.runtime.js";

@@ -448,8 +449,32 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag

448449

let streamSession: SlackStreamSession | null = null;

449450

let streamFailed = false;

450451

let usedReplyThreadTs: string | undefined;

452+

let usedBlockReplyThreadTs: string | undefined;

451453

let observedReplyDelivery = false;

452454

const deliveryTracker = createSlackTurnDeliveryTracker();

455+

const resolveDeliveryThreadTs = (params: {

456+

kind: ReplyDispatchKind;

457+

forcedThreadTs?: string;

458+

}): string | undefined => {

459+

const plannedThreadTs = params.forcedThreadTs ? undefined : replyPlan.nextThreadTs();

460+

return (

461+

params.forcedThreadTs ??

462+

plannedThreadTs ??

463+

(params.kind === "block" ? usedBlockReplyThreadTs : undefined)

464+

);

465+

};

466+

const rememberDeliveredThreadTs = (

467+

kind: ReplyDispatchKind,

468+

deliveredThreadTs: string | undefined,

469+

) => {

470+

if (!deliveredThreadTs) {

471+

return;

472+

}

473+

usedReplyThreadTs ??= deliveredThreadTs;

474+

if (kind === "block") {

475+

usedBlockReplyThreadTs = deliveredThreadTs;

476+

}

477+

};

453478

const deliverPendingStreamFallback = async (

454479

session: SlackStreamSession,

455480

err: SlackStreamNotDeliveredError,

@@ -499,7 +524,7 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag

499524

kind: ReplyDispatchKind;

500525

forcedThreadTs?: string;

501526

}): Promise<void> => {

502-

const replyThreadTs = params.forcedThreadTs ?? replyPlan.nextThreadTs();

527+

const replyThreadTs = resolveDeliveryThreadTs(params);

503528

if (

504529

deliveryTracker.hasDelivered({

505530

kind: params.kind,

@@ -523,10 +548,13 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag

523548

...(slackIdentity ? { identity: slackIdentity } : {}),

524549

});

525550

observedReplyDelivery = true;

551+

const deliveredThreadTs = resolveDeliveredSlackReplyThreadTs({

552+

replyToMode: prepared.replyToMode,

553+

payloadReplyToId: params.payload.replyToId,

554+

replyThreadTs,

555+

});

526556

// Record the thread ts only after confirmed delivery success.

527-

if (replyThreadTs) {

528-

usedReplyThreadTs ??= replyThreadTs;

529-

}

557+

rememberDeliveredThreadTs(params.kind, deliveredThreadTs);

530558

replyPlan.markSent();

531559

deliveryTracker.markDelivered({

532560

kind: params.kind,

@@ -553,6 +581,7 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag

553581

threadTs: params.session.threadTs,

554582

textOverride: params.textOverride,

555583

});

584+

rememberDeliveredThreadTs(params.kind, params.session.threadTs);

556585

return true;

557586

};

558587

@@ -586,7 +615,10 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag

586615

"slack-stream: no reply thread target for stream start, falling back to normal delivery",

587616

);

588617

streamFailed = true;

589-

await deliverNormally({ payload: params.payload, kind: params.kind });

618+

await deliverNormally({

619+

payload: params.payload,

620+

kind: params.kind,

621+

});

590622

return;

591623

}

592624

if (

@@ -619,7 +651,7 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag

619651

if (streamSession.delivered) {

620652

observedReplyDelivery = true;

621653

}

622-

usedReplyThreadTs ??= streamThreadTs;

654+

rememberDeliveredThreadTs(params.kind, streamThreadTs);

623655

replyPlan.markSent();

624656

deliveryTracker.markDelivered({

625657

kind: params.kind,

@@ -792,7 +824,10 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag

792824

});

793825

},

794826

deliverNormally: async () => {

795-

await deliverNormally({ payload, kind: info.kind });

827+

await deliverNormally({

828+

payload,

829+

kind: info.kind,

830+

});

796831

},

797832

onPreviewFinalized: (_preview) => {

798833

const finalThreadTs = usedReplyThreadTs ?? statusThreadTs;