Skip to content

Add reply_in_thread config option for Slack platform #2662

@patp

Description

@patp

Problem

When a Hermes agent on Slack replies to a channel message, it always creates a thread reply (sets thread_ts to the original message's ts). Many teams prefer direct channel replies — thread replies bury the bot's response and require an extra click to see.

Proposed solution

Add a reply_in_thread option (default true for backward compatibility) to the Slack platform config:

platforms:
  slack:
    extra:
      reply_in_thread: false

When false, _resolve_thread_ts() in gateway/platforms/slack.py returns None for top-level channel messages, so replies go directly to the channel. Messages that originate inside an existing thread still get threaded replies (preserves thread context).

Implementation

The change is minimal — a 4-line guard at the top of _resolve_thread_ts():

def _resolve_thread_ts(self, reply_to=None, metadata=None):
    # When reply_in_thread is disabled, only keep threading for
    # messages already inside an existing thread.
    if not self.config.extra.get("reply_in_thread", True):
        if metadata and metadata.get("thread_id"):
            return metadata["thread_id"]
        return None

    # ... existing logic unchanged

Happy to open a PR if there's interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions