hermes - 💡(How to fix) Fix Slack: explicit @mention in active thread should refresh thread context [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

In multi-agent Slack threads, explicit mentions are how users route work to a specific agent. If Hermes has already participated in the thread, a later explicit @Hermes should mean "look at the current thread and respond," not "continue from the old active session context only."

This creates a confusing failure mode where Hermes appears to ignore another bot's recent reply even though the user explicitly addressed Hermes after that reply.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Bug Description

In Slack threads, Hermes fetches thread context when it is first mentioned in a thread. However, once that thread already has an active Hermes session, a later thread reply that explicitly mentions the Hermes bot does not re-fetch the Slack thread context.

This means Hermes can miss messages that were added to the thread after the initial context fetch. The issue is especially visible in multi-agent Slack workflows where another bot or integration replies in the same thread, and a user later explicitly @mentions Hermes again expecting it to read the current thread state.

The explicit mention is a fresh user intent signal, but the active-session path appears to treat it like an ordinary follow-up and skips _fetch_thread_context().

Steps to Reproduce

  1. Start a Slack thread and mention Hermes so it fetches the initial thread context.
  2. Let Hermes create/continue an active session for that thread.
  3. Have another bot, integration, or user add a new relevant reply to the same Slack thread.
  4. In a later thread reply, explicitly @mention Hermes again and ask about the updated thread.

Expected Behavior

If the incoming Slack event is a thread reply and the message explicitly mentions the Hermes bot, Hermes should re-fetch the thread context even when the thread already has an active session.

Additionally, explicit @mention should bypass or refresh the thread-context cache so the 60-second cache does not return stale thread contents.

This should not change unmentioned thread-reply behavior:

  • Unmentioned thread replies should behave as they do today.
  • strict_mention semantics should remain unchanged.
  • allow_bots semantics should remain unchanged.
  • Hermes should still avoid feeding its own prior bot messages back into context.

Actual Behavior

When the thread already has an active session, Hermes does not re-fetch thread context on a later explicit @mention. The agent can respond without seeing newer messages that arrived in the Slack thread after the original context fetch.

Why This Matters

In multi-agent Slack threads, explicit mentions are how users route work to a specific agent. If Hermes has already participated in the thread, a later explicit @Hermes should mean "look at the current thread and respond," not "continue from the old active session context only."

This creates a confusing failure mode where Hermes appears to ignore another bot's recent reply even though the user explicitly addressed Hermes after that reply.

Related Work

  • #15421 discusses Slack session/context loss and includes a comment noting that _handle_slack_message only prepends fetched Slack thread context when entering a thread with no active Hermes session.
  • #23141 fixes a very similar active-session refetch issue for investigate triggers and Slack message shortcuts, but the behavior should also apply to normal explicit @Hermes mentions in thread replies.
  • #16200 fixed related Slack thread-context issues around thread parents, multi-workspace cache keys, and preserving third-party bot messages.
  • #6809 introduced Slack thread context rate limiting / TTL cache behavior.
  • #16193 and #8019 are related to strict mention / thread auto-engagement semantics; this issue is not asking to change those semantics.

Suggested Fix Direction

In the Slack adapter, when handling a thread reply:

  1. Detect whether the incoming message explicitly mentions the current Hermes bot.
  2. If it does, force _fetch_thread_context(...) even if _has_active_session_for_thread(...) is true.
  3. Add a way to bypass or refresh _thread_context_cache for this explicit-mention path so conversations.replies is called instead of returning a stale cached thread within the TTL window.
  4. Keep the current behavior for unmentioned thread replies.

Regression tests should cover:

  • Active session exists + thread reply explicitly mentions Hermes => thread context is fetched.
  • Active session exists + unmentioned thread reply => existing behavior unchanged.
  • Explicit mention path bypasses/refetches thread-context cache.
  • strict_mention behavior remains unchanged.
  • allow_bots behavior remains unchanged.

Affected Component

Gateway / Slack adapter

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING