Add per-thread Slack DM sessions#18
Open
HaiyiMei wants to merge 1 commit into
Open
Conversation
HaiyiMei
marked this pull request as ready for review
July 15, 2026 13:39
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
dmSessionScope: peer | thread, with backward-compatiblepeerbehavior by defaultthreadmode to a session key derived from the DM peer and root thread timestampbots get-dm-session-scopeandbots set-dm-session-scopecommands for safe configuration changesUser impact
Operators can isolate separate Slack DM threads into separate agent/Codex sessions while preserving context inside each thread:
A DM without a resolvable thread ID safely falls back to the existing peer session. Setting the scope back to
peerrestores the current one-session-per-peer behavior.Implementation
When
dmSessionScoperesolves tothread, Slack DM routing appends the resolved rootthread_tsto the existing peer session key and exposes the peer session as its parent. Other Slack surfaces and other channels are unchanged.This PR is separate from, but operationally complements, #17. Message-tool mode should include #17 so Slack DM final markers use the same user-keyed target as inbound sessions.
Validation
bun run typecheck— passbun run build— passgit diff --check— passbun run check— 992 pass, 1 unrelated failure inzalo-personal zca-js wrapper > refreshes the stored session after session login succeeds; this is the existing full-suite isolation failure also reproduced on clean upstreammain, and the failing file passes in isolation (3 pass, 0 fail)