feat(slack): add threadDirectMessages option - #776
Closed
dancer wants to merge 3 commits into
Closed
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
threadDirectMessagestoSlackAdapterConfig. when enabled, a top-level DM becomes its own thread root and the bot replies inside that thread, instead of every message and reply landing in one flat DM transcriptit also gives DMs the
thread_tsthat slack's native streaming api requires.chat.startStreamdocumentsthread_tsas required, and the adapter'sstream()returns null on an emptythreadTs, so a flat DM could never stream natively and always fell back to post-and-edit. threaded DMs stream natively, which is the gap described in #503agentViewalready threaded DMs, but only as part of the full agents setup (manifestagent_view,assistant:write, chat tab). that behavior is now available on its own, andagentViewimplies itbehavior
slack:D123:threadDirectMessages: trueslack:D123:{ts}defaults to false. thread ids are storage keys, so flipping the default would orphan existing subscriptions and per-thread state for every deployed slack bot
subscriptions keep working. the existing
openDM()bridge is reused, so when the conversation-scoped thread is subscribed, top-level DMs still route to it andonSubscribedMessageand proactive flows are unaffectedchannels are untouched
implementation
the two
agentViewgates inhandleMessageEventnow read a combineddmThreadingflag:the remaining
agentViewchecks (app_home tab handling, suggested prompts) are agents-ui concerns and stay as they aretest plan
thread_tsopenDM()flowverified against a real slack workspace over socket mode, on a non-agent app so
message.imarrives with nothread_ts:conversations.repliesshows the user's own message as the thread root (thread_ts == ts) with the bot reply inside itconversations.historyshows only user messages at top level withreply_count: 1, so bot replies no longer sit in the flat DMchat.startStreamwith the incoming message ts and no post-and-edit fallbackslack:D...:and the reply lands flat