fix(discord): fetch and inject reply context for incoming messages#30085
Closed
alaamohanad169-ship-it wants to merge 1 commit into
Closed
fix(discord): fetch and inject reply context for incoming messages#30085alaamohanad169-ship-it wants to merge 1 commit into
alaamohanad169-ship-it wants to merge 1 commit into
Conversation
ae6630b to
f28688e
Compare
Contributor
Author
|
Superseded by a rebased version. Closing this PR. |
This was referenced May 23, 2026
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
When a user replies to a message in Discord, Hermes now fetches the referenced message content and prepends it to the incoming message text so the agent understands the context of the reply.
Problem
Issue #30049: When a user replies to a specific message in Discord, Hermes receives the new message text but has no awareness of which message was being replied to. This leads to confusing or incorrect responses because the agent can't see what the user is responding to.
The existing code only captured
reply_to_textwhen Discord provided theresolvedmessage object inline. This is unreliable — it'sNonefor older messages, high-traffic servers, or cross-guild replies.Fix
Two changes in
_handle_message()ingateway/platforms/discord.py:Fetch the referenced message via API when
message.reference.resolvedisNone:Prepends reply context to the message text so the agent sees it:
Caps at 200 characters to avoid flooding the context window.
Testing
resolvedis NoneFixes #30049