Slack
Status: production-ready for DMs + channels via Slack app integrations. Default mode is Socket Mode; HTTP Events API mode is also supported.
Pairing
Slack DMs default to pairing mode.
Slash commands
Native command behavior and command catalog.
Channel troubleshooting
Cross-channel diagnostics and repair playbooks.
Quick setup
Create Slack app and tokens
In Slack app settings:
- enable Socket Mode
- create App Token (
xapp-...) withconnections:write - install app and copy Bot Token (
xoxb-...)
Configure Mayros
json5{ channels: { slack: { enabled: true, mode: "socket", appToken: "xapp-...", botToken: "xoxb-...", }, }, }
Env fallback (default account only):
bashSLACK_APP_TOKEN=xapp-... SLACK_BOT_TOKEN=xoxb-...
Subscribe app events
Subscribe bot events for:
app_mentionmessage.channels,message.groups,message.im,message.mpimreaction_added,reaction_removedmember_joined_channel,member_left_channelchannel_renamepin_added,pin_removed
Also enable App Home Messages Tab for DMs.
Start gateway
bashmayros gateway
Token model
botToken+appTokenare required for Socket Mode.- HTTP mode requires
botToken+signingSecret. - Config tokens override env fallback.
SLACK_BOT_TOKEN/SLACK_APP_TOKENenv fallback applies only to the default account.userToken(xoxp-...) is config-only (no env fallback) and defaults to read-only behavior (userTokenReadOnly: true).- Optional: add
chat:write.customizeif you want outgoing messages to use the active agent identity (customusernameand icon).icon_emojiuses:emoji_name:syntax.
For actions/directory reads, user token can be preferred when configured. For writes, bot token remains preferred; user-token writes are only allowed when userTokenReadOnly: false and bot token is unavailable.
Access control and routing
channels.slack.dmPolicy controls DM access (legacy: channels.slack.dm.policy):
pairing(default)allowlistopen(requireschannels.slack.allowFromto include"*"; legacy:channels.slack.dm.allowFrom)disabled
DM flags:
dm.enabled(default true)channels.slack.allowFrom(preferred)dm.allowFrom(legacy)dm.groupEnabled(group DMs default false)dm.groupChannels(optional MPIM allowlist)
Pairing in DMs uses mayros pairing approve slack <code>.
Commands and slash behavior
- Native command auto-mode is off for Slack (
commands.native: "auto"does not enable Slack native commands). - Enable native Slack command handlers with
channels.slack.commands.native: true(or globalcommands.native: true). - When native commands are enabled, register matching slash commands in Slack (
/<command>names). - If native commands are not enabled, you can run a single configured slash command via
channels.slack.slashCommand. - Native arg menus now adapt their rendering strategy:
- up to 5 options: button blocks
- 6-100 options: static select menu
- more than 100 options: external select with async option filtering when interactivity options handlers are available
- if encoded option values exceed Slack limits, the flow falls back to buttons
- For long option payloads, Slash command argument menus use a confirm dialog before dispatching a selected value.
Default slash command settings:
enabled: falsename: "mayros"sessionPrefix: "slack:slash"ephemeral: true
Slash sessions use isolated keys:
agent:<agentId>:slack:slash:<userId>
and still route command execution against the target conversation session (CommandTargetSessionKey).
Threading, sessions, and reply tags
- DMs route as
direct; channels aschannel; MPIMs asgroup. - With default
session.dmScope=main, Slack DMs collapse to agent main session. - Channel sessions:
agent:<agentId>:slack:channel:<channelId>. - Thread replies can create thread session suffixes (
:thread:<threadTs>) when applicable. channels.slack.thread.historyScopedefault isthread;thread.inheritParentdefault isfalse.channels.slack.thread.initialHistoryLimitcontrols how many existing thread messages are fetched when a new thread session starts (default20; set0to disable).
Reply threading controls:
channels.slack.replyToMode:off|first|all(defaultoff)channels.slack.replyToModeByChatType: perdirect|group|channel- legacy fallback for direct chats:
channels.slack.dm.replyToMode
Manual reply tags are supported:
[[reply_to_current]][[reply_to:<id>]]
Note: replyToMode="off" disables implicit reply threading. Explicit [[reply_to_*]] tags are still honored.
Media, chunking, and delivery
Actions and gates
Slack actions are controlled by channels.slack.actions.*.
Available action groups in current Slack tooling:
| Group | Default |
|---|---|
| messages | enabled |
| reactions | enabled |
| pins | enabled |
| memberInfo | enabled |
| emojiList | enabled |
Events and operational behavior
- Message edits/deletes/thread broadcasts are mapped into system events.
- Reaction add/remove events are mapped into system events.
- Member join/leave, channel created/renamed, and pin add/remove events are mapped into system events.
- Assistant thread status updates (for "is typing..." indicators in threads) use
assistant.threads.setStatusand require bot scopeassistant:write. channel_id_changedcan migrate channel config keys whenconfigWritesis enabled.- Channel topic/purpose metadata is treated as untrusted context and can be injected into routing context.
- Block actions and modal interactions emit structured
Slack interaction: ...system events with rich payload fields:- block actions: selected values, labels, picker values, and
workflow_*metadata - modal
view_submissionandview_closedevents with routed channel metadata and form inputs
- block actions: selected values, labels, picker values, and
Ack reactions
ackReaction sends an acknowledgement emoji while Mayros is processing an inbound message.
Resolution order:
channels.slack.accounts.<accountId>.ackReactionchannels.slack.ackReactionmessages.ackReaction- agent identity emoji fallback (
agents.list[].identity.emoji, else "👀")
Notes:
- Slack expects shortcodes (for example
"eyes"). - Use
""to disable the reaction for a channel or account.
Manifest and scope checklist
Troubleshooting
Text streaming
Mayros supports Slack native text streaming via the Agents and AI Apps API.
By default, streaming is enabled. Disable it per account:
yamlchannels: slack: streaming: false
Requirements
- Enable Agents and AI Apps in your Slack app settings.
- Ensure the app has the
assistant:writescope. - A reply thread must be available for that message. Thread selection still follows
replyToMode.
Behavior
- First text chunk starts a stream (
chat.startStream). - Later text chunks append to the same stream (
chat.appendStream). - End of reply finalizes stream (
chat.stopStream). - Media and non-text payloads fall back to normal delivery.
- If streaming fails mid-reply, Mayros falls back to normal delivery for remaining payloads.
Configuration reference pointers
Primary reference:
-
Configuration reference - Slack
High-signal Slack fields:
- mode/auth:
mode,botToken,appToken,signingSecret,webhookPath,accounts.* - DM access:
dm.enabled,dmPolicy,allowFrom(legacy:dm.policy,dm.allowFrom),dm.groupEnabled,dm.groupChannels - channel access:
groupPolicy,channels.*,channels.*.users,channels.*.requireMention - threading/history:
replyToMode,replyToModeByChatType,thread.*,historyLimit,dmHistoryLimit,dms.*.historyLimit - delivery:
textChunkLimit,chunkMode,mediaMaxMb - ops/features:
configWrites,commands.native,slashCommand.*,actions.*,userToken,userTokenReadOnly
- mode/auth: