hermes - 💡(How to fix) Fix [Bug]: Outbound MEDIA extraction misses .md/.markdown document not sent as file [1 pull requests]

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…

Error Message

Additional Logs / Traceback (optional)

Root Cause

This appears to be because BasePlatformAdapter.extract_media() in gateway/platforms/base.py includes extensions such as .txt, .pdf, and .zip in its MEDIA: regex, but does not include .md or .markdown.

Fix Action

Fixed

Code Example

Report       https://paste.rs/bfuYX
agent.log    https://paste.rs/Oknav
gateway.log  https://paste.rs/b9aiz

---
RAW_BUFFERClick to expand / collapse

Bug Description

Hermes already lists .md as a supported document type, and Telegram can send Markdown files as native document attachments. However, outbound MEDIA: delivery does not currently extract .md or .markdown paths.

When a message contains something like:

text MEDIA:/tmp/example.md

Hermes sends that line as visible text instead of uploading the Markdown file as a document attachment.

This appears to be because BasePlatformAdapter.extract_media() in gateway/platforms/base.py includes extensions such as .txt, .pdf, and .zip in its MEDIA: regex, but does not include .md or .markdown.

Adding md|markdown to the outbound MEDIA: extraction regex fixes the issue and allows Markdown files to be delivered as native document attachments.

Steps to Reproduce

  1. Start a Hermes chat session with Telegram delivery available.

  2. Ask Hermes to create a Markdown file, for example:

Create a small Markdown file at /tmp/hermes-media-test.md and send it to me on Telegram as an attachment.

  1. Hermes creates the file and attempts to send it using an outbound MEDIA: tag similar to:

MEDIA:/tmp/hermes-media-test.md

  1. Check the Telegram chat.

Expected Behavior

Hermes should recognize the .md path as a document attachment and upload the Markdown file to Telegram, the same way it handles .txt, .pdf, and .zip files.

Actual Behavior

The MEDIA:/tmp/hermes-media-test.md path appears as normal message text. No .md file attachment is uploaded.

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

Telegram

Debug Report

Report       https://paste.rs/bfuYX
agent.log    https://paste.rs/Oknav
gateway.log  https://paste.rs/b9aiz

Operating System

Debian GNU/Linux 13 container on Ubuntu VPS host kernel 6.8.0-111-generic

Python Version

3.13.5

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: Outbound MEDIA extraction misses .md/.markdown document not sent as file [1 pull requests]