openclaw - ✅(Solved) Fix Discord inbound attachments lose original filename (saved as UUID) [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59744Fetched 2026-04-08 02:41:01
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
referenced ×2cross-referenced ×1

Fix Action

Fix / Workaround

Agents that need to re-upload or reference files by name (e.g. uploading to external project management tools) cannot determine the original filename, forcing users to manually include the filename in their message text as a workaround.

PR fix notes

PR #59783: fix(discord): preserve original filename in Discord attachment metadata

Description (problem / solution / changelog)

Pass attachment.filename as originalFilename to saveMediaBuffer so the agent receives the original filename in inbound metadata instead of a UUID-based path. Also applies to sticker assets.

Fixes #59744

Changed files

  • .gitignore (modified, +1/-0)
  • extensions/discord/src/monitor/message-utils.test.ts (modified, +7/-1)
  • extensions/discord/src/monitor/message-utils.ts (modified, +2/-0)

Code Example

{
  "media": "/home/node/.openclaw/media/inbound/a7646376-ca3b-4b89-a1d4-d1f91ba90087.png",
  "mime": "image/png"
}
RAW_BUFFERClick to expand / collapse

Bug description

When a user sends a file attachment via Discord, the original filename is lost during ingest. The file is saved to media/inbound/ with a UUID-based name (e.g. a7646376-ca3b-4b89-a1d4-d1f91ba90087.png), and the original filename is not included in the inbound message metadata passed to the agent.

Context passed to the agent

{
  "media": "/home/node/.openclaw/media/inbound/a7646376-ca3b-4b89-a1d4-d1f91ba90087.png",
  "mime": "image/png"
}

The original filename (e.g. RailRoad_TrainStation_photo.png) is not present anywhere in the context.

Expected behavior

The original filename from the Discord attachment should be preserved and passed to the agent in the inbound metadata, similar to the fixes already applied for:

  • WhatsApp (#12614)
  • Telegram (#31757, #31768)

Discord's API always provides the filename in attachment.filename — it just needs to be carried through the ingest pipeline.

Impact

Agents that need to re-upload or reference files by name (e.g. uploading to external project management tools) cannot determine the original filename, forcing users to manually include the filename in their message text as a workaround.

Environment

  • OpenClaw version: v2026.3.31
  • Channel: Discord
  • Platform: Docker (ECS Fargate)

extent analysis

TL;DR

Modify the ingest pipeline to include the original filename from Discord's API in the inbound metadata passed to the agent.

Guidance

  • Review the Discord API integration to ensure that the attachment.filename field is being properly retrieved and stored.
  • Update the ingest pipeline to include the original filename in the metadata, similar to the fixes applied for WhatsApp and Telegram.
  • Verify that the updated metadata includes the original filename by checking the context passed to the agent.
  • Consider adding logging or debugging statements to ensure that the filename is being correctly retrieved and passed through the pipeline.

Example

No explicit code example is provided, but the fix would involve modifying the code that handles the Discord API response to include the attachment.filename field in the metadata.

Notes

The solution assumes that the Discord API is correctly providing the filename in the attachment.filename field. If this is not the case, additional debugging may be required to determine why the filename is not being provided.

Recommendation

Apply a workaround to modify the ingest pipeline to include the original filename in the metadata, as this is a targeted fix that addresses the specific issue at hand.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The original filename from the Discord attachment should be preserved and passed to the agent in the inbound metadata, similar to the fixes already applied for:

  • WhatsApp (#12614)
  • Telegram (#31757, #31768)

Discord's API always provides the filename in attachment.filename — it just needs to be carried through the ingest pipeline.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING