fix(slack): add thread_ts support for Slack message delivery - #14146
Closed
dirtyren wants to merge 1 commit into
Closed
fix(slack): add thread_ts support for Slack message delivery#14146dirtyren wants to merge 1 commit into
dirtyren wants to merge 1 commit into
Conversation
Previously, _parse_target_ref() had no Slack-specific handler, so targets like 'slack:CHANNEL:THREAD_TS' were not parsed correctly — the channel:thread_ts compound string was passed as a single chat_id, causing Slack API 'channel_not_found' errors. This fix adds: 1. _SLACK_TARGET_RE regex to parse Slack channel IDs (C/D/G/W prefix) with optional thread_ts 2. Slack handler in _parse_target_ref() that splits channel and thread 3. thread_id passthrough in _send_to_platform() for the Slack branch 4. thread_ts parameter in _send_slack() to include in API payload
Collaborator
Collaborator
This was referenced Apr 28, 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.
Problem
When using
send_messageor cron job delivery with a Slack target that includes a thread timestamp (e.g.slack:CHANNEL_ID:THREAD_TS), the message fails with a Slack APIchannel_not_founderror.Root Cause
_parse_target_ref()insend_message_tool.pyhad no Slack-specific handler. The compoundCHANNEL_ID:THREAD_TSstring was passed through as a singlechat_idto the Slack API, which doesn't recognize it as a valid channel.Additionally,
_send_to_platform()never passedthread_idto_send_slack(), and_send_slack()didn't accept or use it — so thread replies were impossible for Slack, unlike Discord and Telegram which already had this support.Fix
Four changes in
tools/send_message_tool.py:_SLACK_TARGET_REregex — Parses Slack channel IDs (prefixesC/D/G/Wfollowed by alphanumeric) with an optional:thread_tsdecimal timestamp suffix.Slack handler in
_parse_target_ref()— SplitsCHANNEL:THREAD_TSinto(chat_id, thread_id)for the Slack platform, placed alongside the existing Feishu and Discord handlers.thread_idpassthrough in_send_to_platform()— The Slack branch now passesthread_id=thread_idto_send_slack(), matching how Discord already works.thread_tsin_send_slack()payload — The function now acceptsthread_id=Noneand includes"thread_ts"in the Slack API payload when present.Testing
Verified with cron job delivery to a Slack thread — messages now arrive as thread replies instead of failing with
channel_not_found.Notes
This brings Slack thread support to parity with Discord and Telegram, which already had thread/topic delivery support.