Skip to content

feat: add Slack as a first-class channel#16

Merged
chrysb merged 2 commits intochrysb:mainfrom
keaganstokoe:feature/slack-channel-support
Mar 13, 2026
Merged

feat: add Slack as a first-class channel#16
chrysb merged 2 commits intochrysb:mainfrom
keaganstokoe:feature/slack-channel-support

Conversation

@keaganstokoe
Copy link
Copy Markdown
Contributor

@keaganstokoe keaganstokoe commented Mar 12, 2026

Summary

Adds full Slack channel support across AlphaClaw.

Slack uses Socket Mode, which requires two tokens (Bot Token xoxb- + App Token xapp-) instead of one. This is handled via a new extraEnvKeys property on channel definitions and dual-token logic throughout.

What's included

  • Onboarding wizard: Slack Bot Token and App Token fields with validation (both required)
  • Gateway sync: Dual-token --bot-token / --app-token CLI flags, env var replacement in openclaw.json
  • openclaw.json generation: Both fresh and import onboarding flows, with mode: "socket" and groupPolicy: "open"
  • Channel dashboard: Slack in channel list with icon and status
  • Pairings: Slack pairing support (approve/reject)
  • Create channel modal: App Token field shown when Slack is selected, single-account provider (like Discord)
  • Watchdog notifications: Crash notifications via Slack DM
  • slack-api.js: Minimal Slack Web API wrapper matching the existing telegram-api.js / discord-api.js pattern
  • Channel status: getChannelStatus now uses Object.keys(kChannelDefs) instead of a hardcoded array

Slack app scopes

The Slack app needs these Bot Token Scopes:

app_mentions:read, channels:history, channels:read, chat:write, groups:history, im:history, im:read, im:write, mpim:history, reactions:read, reactions:write, users:read

And one App-Level Token scope: connections:write

Follow-up idea

Right now both Slack token fields show unconditionally in the onboarding wizard alongside Telegram and Discord. The wizard renderer doesn't support conditional field visibility, so a channel picker (tabs or dropdown that only shows fields for the selected channel) would clean this up. Leaving that for a separate PR to keep this one focused.

Test plan

  • All 396 tests pass (1 pre-existing locale-dependent failure unrelated to this change)
  • Onboarding wizard: Slack fields appear, validation requires both tokens
  • Pairing flow: pairing code shows in Slack, auto-appears in AlphaClaw for approval
  • Agent responds to Slack DMs after pairing
  • Channel dashboard shows Slack status
  • Gateway reconnects after network interruption

Adds full Slack channel support across AlphaClaw — onboarding wizard,
channel dashboard, pairings, gateway sync, watchdog notifications,
and the channel creation modal.

Slack uses Socket Mode which requires two tokens (Bot Token + App Token)
rather than one. This is handled via a new `extraEnvKeys` property on
channel definitions and dual-token logic in the gateway sync and
onboarding flows.

Changes:
- Add Slack to channel definitions, env keys, and known vars
- Add Slack Bot Token and App Token fields to onboarding wizard
- Wire Slack into openclaw.json generation (fresh + import flows)
- Handle dual-token channel sync in gateway (--bot-token / --app-token)
- Use Object.keys(kChannelDefs) instead of hardcoded channel arrays
- Add Slack to channel dashboard, pairings UI, and pairing routes
- Add App Token field to create-channel modal (Slack is single-account)
- Add watchdog crash notifications via Slack DM
- Add slack-api.js (minimal Web API wrapper matching existing patterns)
- Add Slack SVG icon
- Update agents-service test for Slack channel account

Ref: chrysb#8

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chrysb
Copy link
Copy Markdown
Owner

chrysb commented Mar 12, 2026

sweet i've been wanting to get to this. thanks for your submission! will review

Close Slack channel setup gaps by persisting app tokens in edit/manage flows, hiding managed Slack tokens from Envars, and enforcing single-account rules consistently in UI and server logic. Align channel add UX across views by reusing one add-menu codepath and tighten setup guidance copy.
@chrysb
Copy link
Copy Markdown
Owner

chrysb commented Mar 13, 2026

This is awesome — thank you again for putting this together. 🙌

I pulled this in locally and made a few maintainer follow-ups to align with AlphaClaw UX patterns and close some edge cases before merge:

  • completed Slack dual-token plumbing in channel account flows (bot token + app token)
  • ensured Slack app token is hidden/managed like other channel tokens in Envars
  • fixed Slack edit flow so app token reloads correctly
  • enforced Slack single-account behavior to match Discord (UI + server-side guard)
  • updated setup copy/instructions in the channel modal (including Socket Mode, App Home messaging toggle, Event Subscriptions + message.im)
  • refreshed Slack icon and tightened some spacing/copy polish
  • deduplicated add-channel disable logic via shared codepath so both channel views stay in sync

Huge thanks again for the contribution — this will ship in the next release.

@chrysb chrysb merged commit 963b5e5 into chrysb:main Mar 13, 2026
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