Skip to content

Slack ​

Bishop connects to Slack over Socket Mode, so it needs outbound access only.

Setup ​

From the agent's directory:

sh
bishop slack setup

It asks for an app name, a display name, and a description, defaulting the name to the directory name. Pass them as flags to skip the questions:

sh
bishop slack setup --name salesforce-guy \
    --display-name "Salesforce Guy" \
    --description "Answers Salesforce admin questions"

--no-prompt takes the defaults instead of asking. Bishop assumes it when there's no terminal, so this works in a script.

Setup creates the Slack app, installs it, writes the bot and app tokens to .env, and records the app in .bishop/config.json. It also asks for your own entry, like slack:you@example.com, and makes you the first admin; --admin gives it without asking. Then start Bishop:

sh
bishop

Invite the bot to a channel, or DM it directly.

Nobody but you can use the agent until you give them a level, with `! permissions set @dana write` in Slack or bishop permissions set. See Permission Levels.

Without the Slack CLI ​

If you can't install the CLI, or somebody else owns app creation in your workspace, Bishop can adopt an app you set up by hand.

First get the manifest, so the scopes and events are right by construction:

sh
bishop slack manifest > manifest.json

Create the app in Slack from that file (Create New App, then From a manifest), install it to the workspace, then collect two tokens from App Settings: the bot token (xoxb-) under OAuth & Permissions, and an app-level token (xapp-) with connections:write under Basic Information.

sh
bishop slack setup --manual

It asks for both tokens, checks them against Slack, and builds the config from what Slack reports. You don't have to type the app ID or name: auth.test returns them.

One thing it can't check is which events the app subscribes to. If the agent never answers anything, that's the first place to look.

How setup gets the tokens ​

Socket Mode needs an app-level (xapp-) token, and no Slack API will mint one. The slack CLI does, and hands it to a project it runs. So setup writes a throwaway Slack project, runs it once to collect both tokens, and stops it. The CLI creates that app as a dev app and appends (local) to its name, so setup pushes the intended manifest over it afterward. That changes no permissions and needs no reinstall.

The CLI's login expires after 12 hours. If setup says the app kept its (local) suffix, run slack auth login again, or rename the app in Slack.

Using it ​

DM the bot and every message reaches the agent.

@-mention it in a channel to start a thread. Bishop replies in that thread and follows the conversation there. It ignores everything else in the channel, including messages in threads it isn't part of.

Each thread is its own agent session with its own history, and picks up where it left off, including after Bishop restarts.

Each thread is named in Slack's agent sidebar. Bishop names the thread's Slack agent session after the message that started the thread, and the agent can rename it with its slack_rename_session tool whenever it decides a better name would help, at any permission level.

A turn shows its work. Slack marks the thread as working for as long as the agent is, which is also the stop button. Everything the agent writes lands as its own message as it writes it, and the tools it calls in between share a card that says what it is doing now. When the run of tool calls ends, the card becomes a line saying how many it used. The turn closes with the answer and a line saying how long it took, or how long it ran before you stopped it. ! verbosity turns this down.

It stays working while its subagents do. On the Claude harness, an agent that leaves work running in the background after its answer, work that will end with a report back, keeps the thread marked as working until it finishes and the agent has reported back. That is subagents, workflows and slow tool calls it sent to the background. Commands it leaves running, like a dev server, don't count, since they may never finish. Pressing stop then stops that work, and any report the agent is writing about it. Commands it started keep running.

It doesn't answer every message in a busy thread. In a thread where more than one other person is talking, the agent can leave a message alone when it wasn't for the agent. Slack still shows it thinking for a moment, the way somebody starts typing and then doesn't send. With a decision model configured, a message that clearly isn't for the agent shows nothing at all, and the agent reads it the next time it's asked something there. It always answers a person who @-mentions it, and always answers in a thread where you're the only other person talking.

Write while it's working. A message sent mid-turn gets an ⏳ and waits, rather than starting a second turn in the same conversation. When the turn ends, everything waiting goes to the agent as one prompt, with who wrote each one attached. Edit or delete a waiting message and the agent sees the change.

Share files with it. Attach a file to a message and the agent gets the path, screenshots included. Tag the agent into a thread that already has files in it and it's told what was shared, then downloads the ones it needs. See Files.

It can find other conversations in the same place, and in public channels. Ask what was decided last week and the agent can search the other threads in the same channel or DM, however recent, by words, by dates, by who said it, or all three. In a conversation where everyone is in your workspace, it can also search every public Slack channel it has talked in, or one by name. It never searches another private channel or DM, and it searches no public channels where a guest or someone from another organization could read the answer. Each result says who said it, where and when, with a link to the message. It finds only what people saw, which is their messages and the answers it posted. A message edited or deleted afterwards is still found as first written. It reaches back as far as cleanup keeps threads, and nothing from before the Bishop version that added search.

It can search the whole channel or DM, too. When the agent wasn't part of a conversation, it can read back through everything posted in the channel or DM it's talking in, threads included, from before it joined and from people below the conversation's level, each marked with their level so the agent knows who can't direct it. Where everyone in the conversation is in your workspace, it can also search another public channel it has been added to, and read a message there from a link. It never reads another private channel or DM, and never joins a channel: when it isn't in one, it says so, and anyone in that channel can add it. A scheduled report can't use them. It reads Slack as it is now, so edits show and deleted messages are gone. It reads rather than searches, so it stops after 500 messages by default (the agent can ask for up to 2,000) or 30 seconds, and says how far back it got. A reply in a thread that started before the dates the agent searched isn't found. Group DMs can't be searched yet.

Mentions work both ways. The agent reads mentions of other people as names, and when it writes @name Bishop turns it into a real mention. A name that matches nobody, or more than one account, stays plain text. @here, @channel, and @everyone are never converted, so an agent can't wake a workspace.

Stop a turn. In a DM, Slack shows a stop button for as long as the turn runs. ! stop does the same in any thread, and anything sent while the turn was running is answered next.

Long answers are split. Slack caps messages near 4000 characters. Slack also doesn't render tables and handles nested lists badly, so agent output written for a terminal will sometimes look wrong in a thread.

Other agents ​

Pull two agents into the same thread and they can address each other, and the one you're talking to is told which messages came from another agent rather than a person.

  • By default, a bot can't start a conversation. The agent answers a bot only in a thread that already has a session. To let a bot start a new thread by @mentioning the agent, set slack.bots.startConversations. Use it when agents should hand work to each other, such as one agent testing another or delegating tasks to it. The bot can then start work no person asked for.
  • A person must be able to see the conversation. The agent answers a bot only in a channel with at least one person in it. Guests count. Bots can never DM each other.
  • Apps that post under a name rather than an account, like an incoming webhook, are never answered.
  • Exchanges between bots are limited. After three bot turns in a row in a thread, Bishop says it's waiting for a person and stops answering bots there. Change the limit with slack.bots.maxTurns. It can be raised but not turned off.
  • The agent answers a bot's first message in a thread the same way it would answer a person's, so a bot that @mentions it in a new thread, or in a thread the agent isn't in yet, gets a reply.
  • The agent can ignore a bot's later messages in a thread, even one that @mentions it, so two agents don't keep thanking each other until they hit the limit. If you've configured a decision model, it is told the message came from a bot. Set slack.bots.replyPolicy to standard to have the agent treat every bot message the way it treats a person's.

A bot needs a permission level, like a person, and its turns can use any of Bishop's tools that level allows. To keep a bot out, set it to deny. An agent at high verbosity posts progress updates that the other agent reads as messages, so if exchanges stop early, lower that agent's verbosity or raise the limit.

Scopes ​

An app installed by an older Bishop can be missing scopes a newer one uses. To grant them, update the app from the manifest bishop slack manifest prints and reinstall it from App Settings.

  • files:read and files:write are what files need. Bishop warns at startup about each one missing, and until they're granted the agent sees a note in place of each file and a file it sends fails to upload.
  • channels:read, groups:read and im:write are what adding a schedule with a Slack destination needs. bishop schedules add names the missing one. channels:read is also what lets the agent search or read another public channel; without it the agent says the app needs reinstalling.