Skip to content

feat: implement Slack Socket Mode listener for inbound events - #289

Merged
bamdadd merged 2 commits into
mainfrom
feat/slack-socket-mode-listener
Apr 7, 2026
Merged

feat: implement Slack Socket Mode listener for inbound events#289
bamdadd merged 2 commits into
mainfrom
feat/slack-socket-mode-listener

Conversation

@bamdadd

@bamdadd bamdadd commented Apr 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add SlackSocketModeListener (low-level slack-bolt wrapper) and SlackSocketListener (high-level with ChatService dispatch) for receiving Slack messages and approval actions via Socket Mode WebSocket
  • Listener starts automatically on app startup when Slack credentials include an xapp- app-level token
  • Connect/disconnect endpoints start/stop the listener automatically
  • restore_slack_from_store restores credentials from credential store on boot

Work Item

fa92ef76-3c71-4e03-aff0-715e6a855fc1

Changes

  • packages/slack: New socket_mode_listener.py (core listener) and socket_listener.py (dispatch wrapper)
  • packages/settings-api: Added restore_slack_from_store, start_slack_socket_listener, stop_slack_socket_listener; wired into connect/disconnect endpoints
  • packages/app: Lifespan wires restore + start on boot, stop on shutdown
  • packages/slack/tests: 10 new tests for both listener classes

Test Plan

  • Package tests pass (make test-slack — 111 passed)
  • Settings API tests pass (make test-settings-api — 35 passed)
  • Lint + typecheck pass

Add SlackSocketModeListener (low-level) and SlackSocketListener (high-level)
to receive Slack messages and approval actions via Socket Mode WebSocket.

- SlackSocketModeListener wraps slack-bolt AsyncApp + AsyncSocketModeHandler
- SlackSocketListener dispatches inbound messages through ChatService pipeline
- Approval button actions (approve/reject) published to event bus
- Listener starts on app startup when Slack credentials include app_token
- Connect/disconnect endpoints start/stop the listener automatically
- restore_slack_from_store restores credentials from credential store on boot

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@bamdadd
bamdadd force-pushed the feat/slack-socket-mode-listener branch from 9543cdd to b8843d5 Compare April 7, 2026 17:14
The listener was starting before chat_router was set on app.state, which
meant any inbound Slack messages during startup would be silently dropped.
Also removed a duplicate restore_slack_from_store call.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@bamdadd
bamdadd merged commit 987cf0e into main Apr 7, 2026
3 checks passed
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.

1 participant