fix(slack): use threadId from delivery context as threadTs fallback in outbound adapter#22485
Closed
dorukardahan wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(slack): use threadId from delivery context as threadTs fallback in outbound adapter#22485dorukardahan wants to merge 1 commit intoopenclaw:mainfrom
dorukardahan wants to merge 1 commit intoopenclaw:mainfrom
Conversation
…n outbound adapter The Slack outbound adapter's sendText and sendMedia functions only used replyToId as the Slack thread_ts parameter. The delivery context also carries threadId (e.g. from subagent announce flows, gateway send RPC), but this was never destructured or used. This caused subagent completion announcements to land in the main DM instead of the originating Slack thread — the threadId was correctly propagated through the entire announce pipeline but silently dropped at the final Slack delivery step. Fix: destructure threadId from the outbound context and use it as a fallback when replyToId is not set. Fixes openclaw#22483
Contributor
Author
|
CI Note: The |
Member
|
Consolidating this into #23836 so we ship a single Slack extension threading fix with tests + changelog:
Closing this as superseded to keep review/merge clean. |
Member
|
Superseded by #23836. |
This was referenced Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Slack outbound adapter's
sendTextandsendMediafunctions only usedreplyToIdas the Slackthread_tsparameter. The delivery context also carriesthreadId(e.g. from subagent announce flows, gatewaysendRPC), but this field was never destructured or mapped tothreadTs.This caused subagent completion announcements (
sessions_spawn) to land in the main Slack DM instead of the originating thread.Root Cause
In
extensions/slack/src/channel.ts, the outbound functions destructuredreplyToIdbut notthreadId:The delivery chain (
deliverOutboundPayloads→createChannelOutboundContextBase→resolveCtx) correctly propagatesthreadIdthrough to the outbound adapter, but the Slack adapter never reads it.Fix
Destructure
threadIdand use as fallback:Same for
sendMedia.Testing
sendMessageSlackto tracethreadTsvaluethreadTs=NONEdespitethreadIdbeing present in announce flowthreadTs=1771478217.865789✅ — announce lands in correct threadTested with multiple
sessions_spawncalls from a Slack DM thread. All announcements now correctly route to the originating thread.AI Disclosure
Fixes #22483
Related: #17731, #22118
Greptile Summary
Fixes thread routing issue in Slack adapter by adding
threadIdas a fallback toreplyToIdwhen determining the Slackthread_tsparameter. This ensures subagent completion announcements and other flows that only providethreadId(notreplyToId) correctly land in the originating thread rather than the main DM channel.threadIdparameter in bothsendTextandsendMediafunctionsreplyToId ?? threadId ?? undefinedforthreadTssessions_spawnflows to verify announcements now route to correct threadConfidence Score: 5/5
threadIdas a fallback parameter (already present in the type definition) using a simple nullish coalescing chain. The Telegram adapter uses the same pattern, confirming this is the correct approach. The author has tested the fix with livesessions_spawncalls and confirmed the thread routing now works correctly. No breaking changes or side effects expected.Last reviewed commit: 289c9a9
(4/5) You can add custom instructions or style guidelines for the agent here!