ADR-001: Adopt Slack Socket Mode for ADLC and PDLC Orchestrators

ADR-001: Adopt Slack Socket Mode for ADLC and PDLC Orchestrators

Context

The ADLC and PDLC orchestrators currently integrate with Slack using a polling-based architecture:

  1. Inbound messages: slack-bridge.sh polls the Slack conversations.history API every 30 seconds, parses new messages, and injects them into the Claude tmux session via tmux send-keys. When tmux is down, messages are written to a filesystem inbox (~/dev/ops/slack-inbox/) for the dispatcher to pick up on its next 5-minute cycle.

  2. Outbound messages: All agents and the dispatcher post to Slack using direct curl calls to the chat.postMessage API endpoint, constructing JSON payloads inline in bash.

  3. Dispatcher cycle: The dispatcher-v3.sh runs every 5 minutes via systemd timer. Combined with the 30-second polling interval of slack-bridge.sh, this introduces up to 5.5 minutes of latency between a human sending a Slack message and the system acting on it.

This architecture has several problems:

The DeerFlow vs ADLC comparison (FIND-20260323-009) identified Slack Socket Mode as a Phase 1 quick win (6-8 hours effort) with high ROI for improving human-in-the-loop responsiveness.

Decision

Replace the current webhook/polling-based Slack integration with Slack Socket Mode for both ADLC and PDLC orchestrators.

What changes

  1. New component: A lightweight Node.js (or Python) Socket Mode client replaces slack-bridge.sh. This process maintains a persistent WebSocket connection to Slack and receives events in real time.

  2. Inbound flow: Instead of polling conversations.history, the Socket Mode client receives message events instantly via WebSocket. It writes structured JSON messages to a Unix domain socket or named pipe that the dispatcher and Claude supervisor can read.

  3. Outbound flow: Outbound posting continues to use the chat.postMessage Web API (this is unchanged). The Socket Mode client may optionally provide a local HTTP endpoint for agents to post through, adding retry logic and rate-limit handling.

  4. Dispatcher integration: The dispatcher-v3.sh reads from the new message queue (Unix socket/pipe/directory) instead of relying on tmux injection. Messages arrive in structured JSON format, eliminating parsing fragility.

  5. Acknowledgment: Socket Mode requires explicit acknowledgment of events within 3 seconds. The client acknowledges immediately upon receipt, then queues for processing.

Affected services

Slack app changes required

Rollout plan

  1. Phase 1 (4h): Build Socket Mode client, test locally against a dev Slack workspace
  2. Phase 2 (2h): Modify dispatcher-v3.sh to read from the new message queue instead of tmux/inbox
  3. Phase 3 (1h): Deploy, run in parallel with old slack-bridge.sh for 24h
  4. Phase 4 (1h): Disable old slack-bridge.sh, remove systemd polling service

Consequences

Positive

Negative

Neutral

Alternatives Considered

Alternative 1: Reduce polling interval to 5 seconds

Alternative 2: Slack Events API with HTTP webhook

Alternative 3: Keep current architecture, optimize dispatcher cycle

References