Summary
The Discord adapter does not handle message attachments. DiscordGatewayMessage has no attachment fields, DiscordNetGatewayClient.OnMessageReceivedAsync ignores message.Attachments, and all inbound messages arrive with hasMedia=False. Users sending images or files in Discord get no indication their attachments were received.
Current State
DiscordGatewayMessage (in DiscordTransportContracts.cs) has no attachment/media fields
DiscordNetGatewayClient.OnMessageReceivedAsync extracts only message.Content (text)
DiscordSessionBindingActor always sends hasMedia=False to the session pipeline
ChannelAttachments config exists in audience profiles but has no effect since attachments are never extracted
Expected Behavior
Match Slack's attachment ingress pipeline:
- Extract
message.Attachments from Discord.Net's SocketUserMessage
- Validate against
ChannelAttachments.AllowedCategories and MaxFileBytes for the session's audience
- Download attachments to the session media directory
- Include attachment metadata in
ChannelInput so the LLM receives them
- Support images, PDFs, documents, and other file types based on audience config
Reference Implementation
The Slack adapter has a complete attachment pipeline to mirror:
SlackThreadBindingActor — attachment ingress handling, download, and ChannelInput assembly
SlackFileFlowIntegrationTests.cs — comprehensive test coverage for file ingress scenarios
ChannelAttachmentPolicy — shared validation logic for attachment categories and size limits
Test Coverage Required
Following the Slack test patterns in SlackFileFlowIntegrationTests.cs:
- Image attachment accepted for allowed audience
- Attachment rejected when category not in
AllowedCategories
- Attachment rejected when exceeding
MaxFileBytes
- Multiple attachments in a single message
- Attachment with text content (mixed message)
- Attachment-only message (no text)
- Attachment download failure degrades gracefully
Discovered During
Live Discord integration testing — sent an image in a public channel thread, session logged hasMedia=False and bot had no awareness of the attachment.
Summary
The Discord adapter does not handle message attachments.
DiscordGatewayMessagehas no attachment fields,DiscordNetGatewayClient.OnMessageReceivedAsyncignoresmessage.Attachments, and all inbound messages arrive withhasMedia=False. Users sending images or files in Discord get no indication their attachments were received.Current State
DiscordGatewayMessage(inDiscordTransportContracts.cs) has no attachment/media fieldsDiscordNetGatewayClient.OnMessageReceivedAsyncextracts onlymessage.Content(text)DiscordSessionBindingActoralways sendshasMedia=Falseto the session pipelineChannelAttachmentsconfig exists in audience profiles but has no effect since attachments are never extractedExpected Behavior
Match Slack's attachment ingress pipeline:
message.Attachmentsfrom Discord.Net'sSocketUserMessageChannelAttachments.AllowedCategoriesandMaxFileBytesfor the session's audienceChannelInputso the LLM receives themReference Implementation
The Slack adapter has a complete attachment pipeline to mirror:
SlackThreadBindingActor— attachment ingress handling, download, andChannelInputassemblySlackFileFlowIntegrationTests.cs— comprehensive test coverage for file ingress scenariosChannelAttachmentPolicy— shared validation logic for attachment categories and size limitsTest Coverage Required
Following the Slack test patterns in
SlackFileFlowIntegrationTests.cs:AllowedCategoriesMaxFileBytesDiscovered During
Live Discord integration testing — sent an image in a public channel thread, session logged
hasMedia=Falseand bot had no awareness of the attachment.