Skip to content

[Bug]: Discord: inbound file attachments missing from agent context (attachments not passed to agent on message receive) #28296

@haoyan-yam

Description

@haoyan-yam

Summary

When a user sends a file attachment in a Discord DM or guild channel, the attachment is not included in the agent's inbound context. The agent receives the message text but has no knowledge of the attached file.

Steps to reproduce

Steps to Reproduce

Send a message with a file attachment (e.g. .xlsx) in a Discord DM or guild channel where the agent is active
Ask the agent about the file in the same message or a follow-up message
Agent responds as if no attachment was sent

Expected behavior

The agent should receive the attachment metadata (filename, URL, content type) as part of the inbound message context, allowing it to read or process the file.

Actual behavior

The agent's inbound context contains only the message text. The attachments field is absent or empty, even though the raw Discord message — readable via message(action="read") — contains the full attachment data including URL, filename, size, and content type.

Verification: Using the message tool to manually read the channel history returns the correct attachment data:

"attachments": [
{
"filename": "-_.xlsx",
"size": 13572,
"url": "https://cdn.discordapp.com/attachments/...",
"content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"title": "笔记收录_批量导入模版 - 香格里拉"
}
]
But the same message delivered to the agent via normal inbound routing contains no attachment information.


Impact
Affected: All Discord users sending file attachments (DM and guild channels)
Severity: Blocks workflow — file-based tasks (summarize, analyze, read) are completely broken via normal chat; requires manual workaround
Frequency: Always reproducible — every inbound message with attachments is affected
Consequence: Users must use a workaround (agent manually reads channel history via message tool) to access files they already sent; attachment-aware workflows are broken by default


Workaround

Ask the agent to manually fetch recent messages via message(action="read") to retrieve the attachment URL, then process the file separately.


OpenClaw version

OpenClaw version: 2026.2.25

Operating system

OS: macOS (Darwin arm64)

Install method

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions