Skip to content

feat(channels): add Slack channel integration with Socket Mode#34

Merged
yinwm merged 2 commits intosipeed:mainfrom
corylanou:issue-31-feat-add-slack-channel-integration-with-socket-mode-threads-reactions-and-slash-commands
Feb 12, 2026
Merged

feat(channels): add Slack channel integration with Socket Mode#34
yinwm merged 2 commits intosipeed:mainfrom
corylanou:issue-31-feat-add-slack-channel-integration-with-socket-mode-threads-reactions-and-slash-commands

Conversation

@corylanou
Copy link
Contributor

Summary

  • Add Slack as the 8th messaging channel using Socket Mode (WebSocket-based, no public HTTP endpoint needed)
  • Support bidirectional messaging in channels, DMs, and threads with per-thread session context
  • Handle @mentions, ack reactions (:eyes: on receipt, :white_check_mark: after reply), and /picoclaw slash commands
  • Support file/attachment downloads with Groq Whisper audio transcription
  • Allowlist filtering by Slack user ID

Files Changed

  • pkg/channels/slack.go — Full Slack channel implementation (Socket Mode, events, threads, reactions, files)
  • pkg/channels/slack_test.go — Unit tests for ChatID parsing, bot mention stripping, constructor validation, allowlist
  • pkg/config/config.go — Add SlackConfig struct with bot_token, app_token, allow_from
  • pkg/channels/manager.go — Register Slack channel in initChannels()
  • cmd/picoclaw/main.go — Wire Groq transcriber to Slack channel
  • config.example.json — Add Slack config section
  • go.mod / go.sum — Add github.com/slack-go/slack v0.17.3 dependency

Configuration

{
  "channels": {
    "slack": {
      "enabled": true,
      "bot_token": "xoxb-...",
      "app_token": "xapp-...",
      "allow_from": []
    }
  }
}

Slack App Setup

  1. Create Slack App at api.slack.com/apps
  2. Enable Socket Mode → generate App-Level Token (xapp-...)
  3. Bot Token Scopes: chat:write, channels:history, groups:history, im:history, mpim:history, reactions:read, reactions:write, files:read, commands, app_mentions:read
  4. Event Subscriptions: message.channels, message.groups, message.im, message.mpim, app_mention, reaction_added, reaction_removed
  5. Optional: Create slash command /picoclaw
  6. Install to workspace → copy Bot Token (xoxb-...)

Test plan

  • go build ./... compiles cleanly
  • go test ./... all tests pass
  • go vet ./... no issues
  • Manual test with a Slack workspace (requires Slack App setup)

Closes #31

🤖 Generated with Claude Code

corylanou and others added 2 commits February 11, 2026 12:48
Add Slack as a messaging channel using Socket Mode (WebSocket), bringing
the total supported channels to 8. Features include bidirectional
messaging, thread support with per-thread session context, @mention
handling, ack reactions (:eyes:/:white_check_mark:), slash commands,
file/attachment support with Groq Whisper audio transcription, and
allowlist filtering by Slack user ID.

Closes sipeed#31

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…with-socket-mode-threads-reactions-and-slash-commands
@yinwm
Copy link
Collaborator

yinwm commented Feb 12, 2026

Great work on adding Slack support! The code is well-structured and the tests look good.

I found two issues that should be fixed (these also exist in discord.go - would be great to fix both in one go):

  1. HTTP download has no timeout

Location: pkg/channels/slack.go:346
resp, err := http.DefaultClient.Do(req)

http.DefaultClient has no timeout, so the request can hang indefinitely on network issues.

Fix:
client := &http.Client{Timeout: 60 * time.Second}
resp, err := client.Do(req)

  1. context.Background() breaks cancellation chain

Location: pkg/channels/slack.go:286
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)

Using context.Background() creates a new context tree that won't be cancelled when the app shuts down. Since SlackChannel already has c.ctx from
Start(), it should be used.

Fix:
ctx, cancel := context.WithTimeout(c.ctx, 30*time.Second)


I'll be sending a follow-up fix PR today to address these. Just documenting here for visibility!

@yinwm yinwm merged commit 292a371 into sipeed:main Feb 12, 2026
@Zepan
Copy link
Contributor

Zepan commented Feb 13, 2026

Thanks for your contribution! We are forming the PicoClaw Dev Group to accelerate the evolution of the project. Any developer with more than one merged PR is invited to join.

Would you like to join the PicoClaw Dev Group? If so, please send an email to support@sipeed.com with the subject line: [Join PicoClaw Dev Group] + Your GitHub account. We will send the Discord invite link to your inbox.

emadomedher pushed a commit to emadomedher/picoclaw that referenced this pull request Feb 17, 2026
…hannel-integration-with-socket-mode-threads-reactions-and-slash-commands

feat(channels): add Slack channel integration with Socket Mode
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.

feat: Add Slack channel integration with Socket Mode, threads, reactions, and slash commands

3 participants