loki-mode

Two-way Slack

On by default. Set LOKI_SLACK_INBOUND=0 to disable the inbound handler (loki slack serve then exits 2).

Without SLACK_BOT_TOKEN or SLACK_SIGNING_SECRET, loki slack serve prints one line naming both and exits 2 without binding a port.

export SLACK_BOT_TOKEN=...        # from env only, never stored by Loki
export SLACK_SIGNING_SECRET=...
loki slack serve --port 3000      # binds 127.0.0.1 unless --host is given

Point the Slack Events API request URL at this server through a tunnel or reverse proxy you control.

What it does

Who can start a run

Set LOKI_SLACK_ALLOWED_USERS to a comma-separated list of Slack user IDs (for example U012ABC,U034DEF). A mention or a BLOCKED-thread answer from any other user is rejected with a short thread reply and nothing is spawned. When it is unset or blank, every mention is rejected (fail closed) and loki slack serve prints one startup line saying so. Set it to * to explicitly allow anyone in the workspace. The trigger server /slack slash command applies the same variable to the form user_id.

Limits: task text over 64 KB is rejected with “task too long” and no run starts. If a run cannot be launched, the thread gets a generic message and the detail (which may include local paths) is logged to stderr only. --port must be a whole number (an empty value exits 2).

App manifest scopes

Bot token scopes: app_mentions:read, chat:write, channels:history (and groups:history for private channels, im:history for DMs).

Subscribe to bot events: app_mention, message.channels (plus message.groups for private channels).

Outbound notifications (PR opened, BLOCKED, finished) are separate and use LOKI_SLACK_WEBHOOK_URL.