fix(slack): switch adapter to Socket Mode#2702
Open
mperraillon wants to merge 1 commit into
Open
Conversation
The Slack channel adapter was wired for HTTP webhook mode:
createSlackAdapter({ botToken, signingSecret })
which requires a publicly reachable URL for Slack to deliver
events to. But the rest of the codebase already expects Socket Mode:
- setup/verify.ts checks for SLACK_BOT_TOKEN + SLACK_APP_TOKEN
- setup/migrate-v2/shared.ts preserves SLACK_APP_TOKEN from v1
- The /add-slack skill walks users through obtaining xapp-... and
xoxb-... (companion PR on main)
Result: a configured install has the right env vars (xapp-... +
xoxb-...) but the adapter ignores SLACK_APP_TOKEN and silently
falls back to webhook mode, which then fails because no signing
secret is set.
Read SLACK_APP_TOKEN, fail-fast if either token is missing, and
pass `mode: 'socket'` + `appToken` to createSlackAdapter so the
underlying @chat-adapter/slack package opens a WebSocket to Slack
instead of expecting inbound HTTP.
Note: this needs @chat-adapter/slack >= 4.27.0 (where the `mode`
and `appToken` fields were added) — the channels-branch lockfile
currently pins 4.26.0. Bumping the slack dep alone pulls in
chat@4.27+, which mismatches the project's pinned chat@4.26.0 and
also surfaces a separate type issue in the chat-sdk-bridge return
type. So this change is best landed alongside a coordinated bump
of @chat-adapter/* and chat — left as a follow-up so this PR
stays focused.
This was referenced Jun 7, 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.
Type of Change
Description
src/channels/slack.tswirescreateSlackAdapterfor HTTP webhook mode (botToken+signingSecret), which requires a publicly reachable URL. But the rest of the codebase already expects Socket Mode:setup/verify.tschecksSLACK_BOT_TOKEN+SLACK_APP_TOKENsetup/migrate-v2/shared.tspreservesSLACK_APP_TOKENfrom v1/add-slackskill onmainwalks users through obtaining an App-Level Token (xapp-...) — see companion PR fix(skill/add-slack): switch to Socket Mode setup #2700Result: a configured install has the right env vars (
xoxb-...+xapp-...) but the adapter ignoresSLACK_APP_TOKENand falls back to webhook mode, which fails because no signing secret is set.Fix
Read
SLACK_APP_TOKEN, fail-fast if either token is missing, and passmode: 'socket'+appTokentocreateSlackAdapter. The underlying@chat-adapter/slackpackage then opens a WebSocket to Slack instead of expecting inbound HTTP.Heads-up for the reviewer
This change needs
@chat-adapter/slack >= 4.27.0(where themodeandappTokenfields were added). The lockfile on this branch pins4.26.0, so the code doesn't compile as-is.I tried bumping
@chat-adapter/slackto^4.27.0alone — it pulls inchat@4.27.0transitively, which doesn't match the project's pinnedchat@4.26.0. Fixing that by bumpingchatto^4.27.0then surfaced a separate type issue:createChatSdkBridge's return type no longer exposesresolveChannelName, breaking the existing pattern used here and intelegram.ts.So the version bump is bigger than a single-adapter fix — it's a coordinated
@chat-adapter/*+chatSDK upgrade across all the channels. I left it out of this PR to keep the diff focused on the Socket Mode switch. Happy to bundle the SDK upgrade in if you'd prefer one PR.Testing
Slack auth completed,Slack socket mode connected, andChannel adapter started channel="slack"on startup. No public URL, no webhook server. DMs deliver end-to-end.