test(gateway): add regression tests for Discord message.txt auto-attachment (#12511)#12519
Closed
konsisumer wants to merge 1 commit into
Closed
Conversation
…chment Covers the scenario from issue NousResearch#12511: when Discord converts a large paste into a message.txt attachment, the gateway must inject the content into event.text so the agent can read the pasted material. Five new tests in TestDiscordMessageTxtAutoAttachment verify: - Free-response channel: bare message.txt paste is injected (no mention needed) - Server channel: @mention + message.txt, content injected after mention strip - Server channel: @mention + caption + message.txt, injection prepended before caption - Server channel: message.txt without @mention is dropped (expected gating) - content_type=None: filename extension fallback still identifies and injects .txt All scenarios pass with the existing gateway implementation, confirming the feature works and establishing a regression baseline.
18 tasks
1 task
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.
Ensure Discord auto-generated
message.txtattachments (from large pastes) are read and injected into the agent's context.What changed and why
TestDiscordMessageTxtAutoAttachmentclass totests/gateway/test_discord_document_handling.pywith 5 targeted scenarios for the exact user flow described in [Bug]: Discord auto-generated message.txt attachments from pasted code/long lines are silently ignored #12511content_type=Nonefilename-extension fallbackHow to test
pytest tests/gateway/test_discord_document_handling.py -v— all 16 tests passmessage.txt; Hermes receives[Content of message.txt]:...prepended to the event textWhat platforms tested on
Fixes #12511
autocontrib · issue-new-76f9beaf · 2026-04-19T10:46:48Z