Skip to content

Conditional thread policy for Slack adapter (DM=top-level, channels=threaded)#2431

Open
jumprope-jesse wants to merge 1 commit into
nanocoai:channelsfrom
distillery-labs:fix/slack-dm-no-threads
Open

Conditional thread policy for Slack adapter (DM=top-level, channels=threaded)#2431
jumprope-jesse wants to merge 1 commit into
nanocoai:channelsfrom
distillery-labs:fix/slack-dm-no-threads

Conversation

@jumprope-jesse
Copy link
Copy Markdown

Summary

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). 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 supportsThreads boolean behavior.

Files

  • src/channels/adapter.ts — new optional shouldUseThreadsFor on ChannelAdapter.
  • src/router.ts — gate uses the override when present, otherwise falls back to supportsThreads.
  • src/channels/slack.ts — sets shouldUseThreadsFor to return false for D-prefixed (DM) platform IDs.

Test plan

  • Slack DM: inbound text + file reply both land at top level (no thread).
  • Slack public/private channel @mention: replies still threaded into the originating thread.
  • Other adapters (Telegram, WhatsApp, Discord) unaffected — no override, same supportsThreads behavior.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants