Skip to content

Slack

What it is

The Slack bot is one of your surfaces: a way for you, the human peer, to reach the mesh from Slack. It is not a peer of its own, and connects to Slack over Socket Mode. No public URL or webhook is required.

When to use it

Use Slack when a team channel should be the Direct view of every conversation, as the Telegram chat is: asks, answers and notices for you, each labelled with its agent. Every message you send is tracked until it is answered (there is no notify or FYI) and waits for an agent that is offline.

An agent's message is shown in Slack's own formatting: bold, italic, strikethrough, inline code, code blocks, links, headings (bold), lists and quotes, with line breaks as written. A table arrives as a code block, as typed, and an image as a link named by its alt text (or its URL). Only http, https and mailto links are links; any other scheme shows as text. Indented and fenced code stay verbatim.

Use Telegram for personal phone control and file uploads. Use the dashboard for timelines, jobs, and richer inspection.

Setup

Create a Slack app with:

  • Bot token (xoxb-...) with chat:write, plus history scopes for the watched channel type. Optional: reactions:write, so a message you send gets a 👍 once it is in, as on Telegram; without it the bot confirms in the message's thread.
  • App-level token (xapp-...) with connections:write.
  • Channel ID (C...) for the channel the bot watches.

For a one-off manual process, start the bot with:

SLACK_BOT_TOKEN=xoxb-... \
SLACK_APP_TOKEN=xapp-... \
SLACK_CHANNEL_ID=C... \
  repowire slack start

Or configure ~/.repowire/config.yaml:

slack:
  bot_token: "xoxb-..."
  app_token: "xapp-..."
  channel_id: "C..."

When all three values are configured, setup installs Slack as an OS-managed user service alongside the daemon. The manual command is only needed when running the bot separately from the daemon host.

Common workflows

In the configured channel:

Input What happens
message Send to the orchestrator, which routes it
@peer message Send to that agent
Reply in an item's thread Answer it (see Threads below)
fwd @peer [note] in an item's thread Forward that item to another agent: an open ask you hold moves to it, anything else is sent on, quoted; to name@machine it is always sent on, quoted, and an open ask stays yours
inbox What needs you (open asks, oldest first), then what is unread
all [n] A digest of the last n items (default 10, at most 50) across every agent
agents (or peers) Who is online
help What the channel does

Each message you send gets a 👍 once it is in (or a short confirmation in its thread without reactions:write), and the agent's answer is posted in its thread. The old select, switch, clear, notify and fyi commands, and the peer buttons, are gone; the bot says so instead of sending them.

Commands and API

Run:

repowire slack start

The bot uses the daemon's normal ask, notify, and event routes. Messages sent from Slack are the human's (agents see @human) and are framed as human input to the receiving agent, and every message from Slack is tracked until it is answered. slack resolves to the human inbox, so a message to slack is stored there even when the bot is down, and Slack is one of its surfaces (see below).

Slack as an inbox surface

The bot declares itself an inbox surface, so the daemon pushes each inbox item to the channel and the sender gets a receipt. repowire trace <delivery id> shows whether the push reached Slack (surface_pushed, with the message ts) or failed (surface_failed with network, rate_limited, rejected, too_long, overloaded or no_receipt).

  • Threads. Each new item starts its own thread. An item on the same ask as an earlier one (an agent's answer to your question, a follow-up) is posted in that item's thread.
  • Replies. Reply in a thread to answer it. A Slack thread reply targets the thread, not one message: it answers the thread's open question when there is one (even under a later progress note), and otherwise the newest item posted there. The reply goes through POST /inbox/reply: it acks the ask behind the item, marks the item read on every surface, and threads the agent's next answer under it. A reply in any other thread, or a new message in the channel, is a new message to the orchestrator (or to @name), and the agent's answer is posted in that message's thread. When an item closes without you (its agent withdrew it, or it expired), or a message you sent expires unanswered, a note in its thread says so.
  • Buttons. A choice question shows its options as buttons, an acknowledge question one Got it button, and a tool approval adds Deny. A tap answers through the inbox, and the outcome is posted in the item's thread.
  • Quiet hours. The bot declares inbox_hold, so human.surfaces.slack.quiet_hours holds its pushes in the configured window (quiet hours).

No extra scopes are needed beyond the setup above. Thread replies arrive as ordinary channel message events, and buttons use Socket Mode interactivity.

Unlike Telegram, Slack has no read sweep: a message you type in the channel does not mark earlier items read. Reply to an item or tap its button, or read it on the dashboard.

Limits

  • The bot watches one configured channel. Messages in other channels are ignored.
  • Multi-user control is possible: anyone with access to the channel can drive the mesh.
  • Socket Mode uses an outbound WebSocket to Slack; the app-level token has broad authority and should be treated like the bot token.
  • The bot retries rate limits and failures to connect up to three times per message. A response lost after Slack received the request is not retried (Slack may have posted it), so the push fails as network rather than posting twice. Such a message can be visible in Slack while recorded as failed, so it may appear again if the item is pushed later (a catch-up or a quiet-hours release).
  • Long items are split into chunks of about 2900 characters (a Block Kit section holds 3000), all in the item's thread.
  • Slack file relay is not currently supported. Photos and documents posted in Slack are not downloaded and forwarded to agents.

Troubleshooting

  • Bot connects but ignores messages: check SLACK_CHANNEL_ID matches the channel you are typing in.
  • Socket Mode URL fetch failed: the app token is wrong or missing connections:write.
  • Bot can read but cannot post: the bot token is missing chat:write for the channel.

See also