feat(slack): thread engagement — auto-respond in bot-started and mentioned threads - #5897
Merged
Conversation
…ioned threads When the bot sends a message in a thread, track its ts in _bot_message_ts. When the bot is @mentioned in a thread, register it in _mentioned_threads. Both sets enable auto-responding to future messages in those threads without requiring repeated @mentions — making the bot behave like a team member that stays engaged once a conversation starts. Channel message gating now checks 4 signals (in order): 1. @mention in this message 2. Reply in a thread the bot started/participated in (_bot_message_ts) 3. Message in a thread where the bot was previously @mentioned (_mentioned_threads) 4. Existing session for this thread (_has_active_session_for_thread — survives restarts) Thread context fetching now triggers on ANY first-entry path (not just @mention), so the agent gets context whether it's entering via a mention, a bot-thread reply, or a mentioned-thread auto-trigger. Both tracking sets are bounded (5000 cap with prune-oldest-half) to prevent unbounded memory growth in long-running deployments. Salvaged from PR #5754 by @hhhonzik. Preserves our existing approval buttons, thread context fetching, and session key fix. Does NOT include the edit_message format_message() removal (that was a regression in the original PR). Tests: 4 new tests for bot-ts tracking and mentioned-thread bounds.
Tommyeds
pushed a commit
to Tommyeds/hermes-agent
that referenced
this pull request
Apr 12, 2026
…ioned threads (NousResearch#5897) When the bot sends a message in a thread, track its ts in _bot_message_ts. When the bot is @mentioned in a thread, register it in _mentioned_threads. Both sets enable auto-responding to future messages in those threads without requiring repeated @mentions — making the bot behave like a team member that stays engaged once a conversation starts. Channel message gating now checks 4 signals (in order): 1. @mention in this message 2. Reply in a thread the bot started/participated in (_bot_message_ts) 3. Message in a thread where the bot was previously @mentioned (_mentioned_threads) 4. Existing session for this thread (_has_active_session_for_thread — survives restarts) Thread context fetching now triggers on ANY first-entry path (not just @mention), so the agent gets context whether it's entering via a mention, a bot-thread reply, or a mentioned-thread auto-trigger. Both tracking sets are bounded (5000 cap with prune-oldest-half) to prevent unbounded memory growth in long-running deployments. Salvaged from PR NousResearch#5754 by @hhhonzik. Preserves our existing approval buttons, thread context fetching, and session key fix. Does NOT include the edit_message format_message() removal (that was a regression in the original PR). Tests: 4 new tests for bot-ts tracking and mentioned-thread bounds.
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
…ioned threads (NousResearch#5897) When the bot sends a message in a thread, track its ts in _bot_message_ts. When the bot is @mentioned in a thread, register it in _mentioned_threads. Both sets enable auto-responding to future messages in those threads without requiring repeated @mentions — making the bot behave like a team member that stays engaged once a conversation starts. Channel message gating now checks 4 signals (in order): 1. @mention in this message 2. Reply in a thread the bot started/participated in (_bot_message_ts) 3. Message in a thread where the bot was previously @mentioned (_mentioned_threads) 4. Existing session for this thread (_has_active_session_for_thread — survives restarts) Thread context fetching now triggers on ANY first-entry path (not just @mention), so the agent gets context whether it's entering via a mention, a bot-thread reply, or a mentioned-thread auto-trigger. Both tracking sets are bounded (5000 cap with prune-oldest-half) to prevent unbounded memory growth in long-running deployments. Salvaged from PR NousResearch#5754 by @hhhonzik. Preserves our existing approval buttons, thread context fetching, and session key fix. Does NOT include the edit_message format_message() removal (that was a regression in the original PR). Tests: 4 new tests for bot-ts tracking and mentioned-thread bounds.
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
…ioned threads (NousResearch#5897) When the bot sends a message in a thread, track its ts in _bot_message_ts. When the bot is @mentioned in a thread, register it in _mentioned_threads. Both sets enable auto-responding to future messages in those threads without requiring repeated @mentions — making the bot behave like a team member that stays engaged once a conversation starts. Channel message gating now checks 4 signals (in order): 1. @mention in this message 2. Reply in a thread the bot started/participated in (_bot_message_ts) 3. Message in a thread where the bot was previously @mentioned (_mentioned_threads) 4. Existing session for this thread (_has_active_session_for_thread — survives restarts) Thread context fetching now triggers on ANY first-entry path (not just @mention), so the agent gets context whether it's entering via a mention, a bot-thread reply, or a mentioned-thread auto-trigger. Both tracking sets are bounded (5000 cap with prune-oldest-half) to prevent unbounded memory growth in long-running deployments. Salvaged from PR NousResearch#5754 by @hhhonzik. Preserves our existing approval buttons, thread context fetching, and session key fix. Does NOT include the edit_message format_message() removal (that was a regression in the original PR). Tests: 4 new tests for bot-ts tracking and mentioned-thread bounds.
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…ioned threads (NousResearch#5897) When the bot sends a message in a thread, track its ts in _bot_message_ts. When the bot is @mentioned in a thread, register it in _mentioned_threads. Both sets enable auto-responding to future messages in those threads without requiring repeated @mentions — making the bot behave like a team member that stays engaged once a conversation starts. Channel message gating now checks 4 signals (in order): 1. @mention in this message 2. Reply in a thread the bot started/participated in (_bot_message_ts) 3. Message in a thread where the bot was previously @mentioned (_mentioned_threads) 4. Existing session for this thread (_has_active_session_for_thread — survives restarts) Thread context fetching now triggers on ANY first-entry path (not just @mention), so the agent gets context whether it's entering via a mention, a bot-thread reply, or a mentioned-thread auto-trigger. Both tracking sets are bounded (5000 cap with prune-oldest-half) to prevent unbounded memory growth in long-running deployments. Salvaged from PR NousResearch#5754 by @hhhonzik. Preserves our existing approval buttons, thread context fetching, and session key fix. Does NOT include the edit_message format_message() removal (that was a regression in the original PR). Tests: 4 new tests for bot-ts tracking and mentioned-thread bounds.
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…ioned threads (NousResearch#5897) When the bot sends a message in a thread, track its ts in _bot_message_ts. When the bot is @mentioned in a thread, register it in _mentioned_threads. Both sets enable auto-responding to future messages in those threads without requiring repeated @mentions — making the bot behave like a team member that stays engaged once a conversation starts. Channel message gating now checks 4 signals (in order): 1. @mention in this message 2. Reply in a thread the bot started/participated in (_bot_message_ts) 3. Message in a thread where the bot was previously @mentioned (_mentioned_threads) 4. Existing session for this thread (_has_active_session_for_thread — survives restarts) Thread context fetching now triggers on ANY first-entry path (not just @mention), so the agent gets context whether it's entering via a mention, a bot-thread reply, or a mentioned-thread auto-trigger. Both tracking sets are bounded (5000 cap with prune-oldest-half) to prevent unbounded memory growth in long-running deployments. Salvaged from PR NousResearch#5754 by @hhhonzik. Preserves our existing approval buttons, thread context fetching, and session key fix. Does NOT include the edit_message format_message() removal (that was a regression in the original PR). Tests: 4 new tests for bot-ts tracking and mentioned-thread bounds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Salvages the thread engagement features from PR #5754 by @hhhonzik onto current main (which already has approval buttons + thread context from #5890).
What changed
Bot-started thread tracking: When the bot sends a message, its
tsis tracked in_bot_message_ts. Thread replies to messages the bot sent now auto-trigger without needing@mention.Mentioned-thread tracking: When the bot is
@mentionedin a thread, that thread is added to_mentioned_threads. All subsequent messages in the thread auto-trigger the bot.Channel gating now checks 4 signals:
@mentionin this message_bot_message_ts)_mentioned_threads)_has_active_session_for_thread— survives restarts)Thread context fetching now triggers on ANY first-entry path, not just
@mention.Memory bounded: Both tracking sets capped at 5000 entries with prune-oldest-half.
What was NOT ported from #5754
edit_messageremovingformat_message()— that was a regression (raw markdown instead of Slack mrkdwn)_has_active_session_for_thread— kept as fallback (survives gateway restarts, unlike in-memory sets)Credits
Feature design by @hhhonzik (PR #5754). Implemented fresh on current main.
Tests
87 Slack tests pass (69 existing + 18 new across approval + engagement)