ai-agents

Make Hermes follow or ignore a Slack thread with one command

John Dwyer | Digital Strategist 4 min read

Out of the box, Hermes decides how chatty it is one channel at a time, in your config file. Either it answers every message, or it waits until someone mentions it. There is one exception. Mention the bot inside a thread and it will follow that thread from then on. What you cannot do is change your mind. Nothing lets you tell the bot to leave one thread alone, and the list of threads it is following is held in memory, so a gateway restart wipes it. This plugin adds two commands you type in the thread itself, and it writes your answer to disk.

Code and install: github.com/Smshd-Avo/hermes-slack-thread-controls

Is this your problem?

  • Someone mentioned the bot in a thread, and now it replies to everything in there. The only way to stop it is to change the settings for the whole channel.
  • You restart the gateway and the bot stops following the threads it was following.
  • You want one thread the bot always answers in, and you want that to stick.
  • You cannot ask the bot what it is set to do in a thread.

What we built

Three commands, typed inside the thread. They work on their own, or with the bot’s name in front. In a channel where the bot waits to be mentioned, use @yourbot !listen the first time, because a message with no mention will not reach it.

CommandWhat it does
!listen or !lFollow every reply in this thread from now on.
!quiet or !qOnly answer in this thread when you mention the bot.
!listeningTell me what this thread is set to.

Your answer goes to disk, so it survives a restart and a plugin update. Stock Hermes keeps its thread memory in a plain set in the running process, so that memory is gone the moment the gateway stops. It can still wake up in a thread after a restart, if a session for that thread is still live or if the first message in the thread mentions it, but the simple “you mentioned me here” memory does not come back. The plugin also switches a thread to listen mode the first time someone mentions the bot there, and a !quiet you typed yourself is never overruled by that.

How to install

hermes plugins install Smshd-Avo/hermes-slack-thread-controls
hermes plugins enable hermes-slack-thread-controls

Every setting is optional. The one worth adding is your bot’s Slack user ID, which the plugin uses to spot mentions:

plugins:
  entries:
    hermes-slack-thread-controls:
      settings:
        bot_user_ids: ["U0123456789"]
        auto_listen_on_first_mention: true

Good to know

  • !listen only works if the bot can see replies that do not mention it. If strict_mention or thread_require_mention is on in your Slack settings, Hermes throws those replies away before the plugin sees them. Turn both off and let the plugin do the gating. !quiet works either way.
  • There is no permission check on the commands. Anyone who can post in the thread can change its setting. Keep the plugin to channels where you trust everyone.
  • !q is also a short form of Hermes’s own queue command. The plugin reads the raw Slack message, so !q still works as quiet. If the plugin ever fails to load, !q will run queue instead. Type !quiet in full if you would rather not risk it.

The code is on GitHub at Smshd-Avo/hermes-slack-thread-controls. MIT licensed, free to use.

If the bot is noisy in Slack for other reasons, our guide to the Hermes Slack display settings covers the rest.

Book your discovery call

Pick a time that suits you and we will have a straight conversation about where your business is at and whether we can help. No obligation, no pitch.

  • No obligation A straight chat about where your business is at. No pitch deck, no pressure to sign anything.
  • Fifteen focused minutes We keep it tight and respect your time, so you get value even from a short call.
  • Clear next steps You leave with at least one practical idea you can act on, whether or not we work together.

Your consultation will be with

John Dwyer, Smashed Avo John Dwyer Founder, Smashed Avo Digital

Not ready for a call?

Write to John instead. A line or two on what is going on is enough.

Write to us

Prefer to contact us directly?

Call, email or use the contact page.