hermes - 💡(How to fix) Fix Gateway MEDIA tags do not recognize markdown attachments

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…

Fix Action

Fix / Workaround

No media tuple is returned, so downstream gateway dispatch never calls the native document send path for the file.

Code Example

from gateway.platforms.base import BasePlatformAdapter

media, cleaned = BasePlatformAdapter.extract_media("Here is the file:\nMEDIA:/tmp/report.md")
print(media)

---

[]

---

[("/tmp/report.md", False)]
RAW_BUFFERClick to expand / collapse

Bug description

Gateway responses can include MEDIA:/path/file.md to send a generated markdown file as a native platform attachment. Today the shared BasePlatformAdapter.extract_media() regex does not recognize .md files, so the media tag is not extracted and no file is sent.

This creates a misleading user experience: the assistant may say "here is the file" while the gateway only sends the surrounding text and silently drops the intended attachment.

The same extractor also misses .html / .htm document paths even though those are useful text-ish report artifacts, and it is case-sensitive for document extensions.

Steps to reproduce

from gateway.platforms.base import BasePlatformAdapter

media, cleaned = BasePlatformAdapter.extract_media("Here is the file:\nMEDIA:/tmp/report.md")
print(media)

Actual behavior

[]

No media tuple is returned, so downstream gateway dispatch never calls the native document send path for the file.

Expected behavior

[("/tmp/report.md", False)]

The MEDIA: tag should be stripped from user-visible text and the file should be routed to the platform attachment/document sender.

Impact

  • Generated markdown handoffs/reports are not delivered as attachments.
  • The assistant can claim a file was attached even though the platform receives only text.
  • Uppercase extensions like .MD are also missed.

Proposed fix

  • Add md, html, and htm to the shared MEDIA: extractor allowlist.
  • Make the extractor case-insensitive.
  • Add focused regression tests for .md, .MD, .html, and .htm.

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

[("/tmp/report.md", False)]

The MEDIA: tag should be stripped from user-visible text and the file should be routed to the platform attachment/document sender.

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 Gateway MEDIA tags do not recognize markdown attachments