fix(slack): stop injecting thread roots as reply context - #21
Merged
Conversation
…on hydration - Simplify `reply_to_text` injections by relying on session history and context hydration instead of explicit parent text refetching. - Refactor `_fetch_thread_parent_text` to focus on availability checks, removing redundant uses. - Update tests to ensure thread contexts are reused without repeated root-injection logic.
Collaborator
Author
|
Hermes PR: NousResearch#79462 |
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.
What does this PR do?
Stops Slack thread replies from repeatedly injecting the thread root as
[Replying to: ...]on every turn.Slack's
thread_tsidentifies the thread root, not an explicit reply target. The adapter already hydrates the root throughchannel_contextwhen a thread session starts, and subsequent turns retain it in session history. Populatingreply_to_textfromthread_tstherefore duplicated up to 500 characters of the root in every user message and caused needless context growth.The fix keeps Slack thread routing unchanged while leaving
reply_to_textintact for platforms with true explicit replies.Related Issue
No exact issue found. The behavior originated from the Slack thread-parent context work in NousResearch#16200 combined with unconditional reply-pointer injection from NousResearch#13676.
Type of Change
Changes Made
plugins/platforms/slack/adapter.py: stop resolving the thread root intoreply_to_text; continue hydrating it throughchannel_contextand retaining cached root text for mention wake checks.tests/gateway/test_slack.py: verify cold-start root hydration and ensure active thread turns neither refetch nor inject the root as reply context.How to Test
[Replying to: ...].scripts/run_tests.sh tests/gateway/test_slack.py tests/gateway/test_reply_to_injection.py -q— 175 passed.Checklist
Code
Documentation & Housekeeping
cli-config.yaml.example— N/A, no config changesCONTRIBUTING.md/AGENTS.md— N/A, no workflow changes