Conditional thread policy for Slack adapter (DM=top-level, channels=threaded)#2431
Open
jumprope-jesse wants to merge 1 commit into
Open
Conditional thread policy for Slack adapter (DM=top-level, channels=threaded)#2431jumprope-jesse wants to merge 1 commit into
jumprope-jesse wants to merge 1 commit into
Conversation
Adds optional shouldUseThreadsFor(platformId) on the ChannelAdapter interface. When defined, the router consults this instead of supportsThreads to decide whether to collapse the inbound threadId. Slack adapter uses it to disable threading only for DM channels (D-prefix), preserving threaded behavior for public/private channels (C/G-prefix). Fixes inconsistent file-send-vs-text-reply UX in Slack DMs by routing both to top-level. Backward compatible — other adapters unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Adds optional
shouldUseThreadsFor(platformId)on theChannelAdapterinterface. When defined, the router consults this instead ofsupportsThreadsto decide whether to collapse the inboundthreadId.Slack adapter uses it to disable threading only for DM channels (D-prefix), preserving threaded behavior for public/private channels (C/G-prefix). This fixes an inconsistent file-send-vs-text-reply UX in Slack DMs by routing both through the same fallback-to-channel-id
tid, so they post at the top level together.Backward compatible — the field is optional; adapters that don't define it keep the existing
supportsThreadsboolean behavior.Files
src/channels/adapter.ts— new optionalshouldUseThreadsForonChannelAdapter.src/router.ts— gate uses the override when present, otherwise falls back tosupportsThreads.src/channels/slack.ts— setsshouldUseThreadsForto returnfalsefor D-prefixed (DM) platform IDs.Test plan
supportsThreadsbehavior.