Summary
Add a Slack adapter to agent-broker, allowing teams to interact with ACP-compatible agents (Kiro CLI, Claude Code, Codex, Gemini) directly from Slack channels and threads.
Motivation
Proposed Architecture
┌──────────────┐ Slack Events API ┌──────────────┐ ACP stdio ┌──────────────┐
│ Slack │◄──────────────────►│ agent-broker │──────────────►│ coding CLI │
│ User │ │ (Rust) │◄── JSON-RPC ──│ (acp mode) │
└──────────────┘ └──────────────┘ └──────────────┘
Adapter Abstraction
To support multiple platforms cleanly, agent-broker should introduce a ChatAdapter trait:
#[async_trait]
trait ChatAdapter {
async fn start(&self, pool: Arc<SessionPool>) -> Result<()>;
async fn send_message(&self, channel: &str, content: &str) -> Result<()>;
async fn edit_message(&self, channel: &str, msg_id: &str, content: &str) -> Result<()>;
async fn create_thread(&self, channel: &str, title: &str) -> Result<String>;
async fn add_reaction(&self, channel: &str, msg_id: &str, emoji: &str) -> Result<()>;
}
Discord, Telegram (#86), and Slack would each implement this trait. The session pool and ACP layer remain unchanged.
Slack-Specific Design
| Feature |
Slack Implementation |
| Trigger |
@mention in allowed channels |
| Threading |
Slack native threads (reply_broadcast optional) |
| Streaming |
Edit message in thread every ~1.5s (same as Discord) |
| Reactions |
Slack emoji reactions for status (👀→🤔→🔥→✅) |
| Auth |
Slack Bot Token + App-Level Token (Socket Mode) |
| Channel allowlist |
Slack channel IDs in allowed_channels |
Config Example
[slack]
bot_token = "${SLACK_BOT_TOKEN}"
app_token = "${SLACK_APP_TOKEN}" # for Socket Mode
allowed_channels = ["C1234567890"]
[agent]
command = "kiro-cli"
args = ["acp", "--trust-all-tools"]
working_dir = "/home/agent"
Connection Mode Options
- Socket Mode (recommended) — no public URL needed, works behind firewalls, similar to Discord Gateway WebSocket
- Events API + HTTP — requires a public endpoint, more complex but supports higher scale
Socket Mode is the natural fit since it mirrors how the Discord adapter works (persistent WebSocket connection).
Implementation Steps
- Abstract
ChatAdapter trait from current Discord implementation
- Refactor Discord handler to implement the trait
- Implement Slack adapter using
slack-morphism or similar Rust Slack SDK
- Add config section for Slack (
[slack] block)
- Select adapter at startup based on which config section is present
- Add Dockerfile variant and Helm values for Slack deployment
Slack Bot Permissions (Scopes)
app_mentions:read — detect @mentions
chat:write — send messages
channels:history — read channel messages
reactions:write — add emoji reactions
channels:read — list channels for validation
Related
Summary
Add a Slack adapter to agent-broker, allowing teams to interact with ACP-compatible agents (Kiro CLI, Claude Code, Codex, Gemini) directly from Slack channels and threads.
Motivation
serenity), with a Telegram adapter proposed in feat: Telegram adapter — session lifecycle, memory compaction & crash recovery #86Proposed Architecture
Adapter Abstraction
To support multiple platforms cleanly, agent-broker should introduce a
ChatAdaptertrait:Discord, Telegram (#86), and Slack would each implement this trait. The session pool and ACP layer remain unchanged.
Slack-Specific Design
@mentionin allowed channelsallowed_channelsConfig Example
Connection Mode Options
Socket Mode is the natural fit since it mirrors how the Discord adapter works (persistent WebSocket connection).
Implementation Steps
ChatAdaptertrait from current Discord implementationslack-morphismor similar Rust Slack SDK[slack]block)Slack Bot Permissions (Scopes)
app_mentions:read— detect @mentionschat:write— send messageschannels:history— read channel messagesreactions:write— add emoji reactionschannels:read— list channels for validationRelated