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.
Bug description
Gateway responses can include
MEDIA:/path/file.mdto send a generated markdown file as a native platform attachment. Today the sharedBasePlatformAdapter.extract_media()regex does not recognize.mdfiles, 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/.htmdocument paths even though those are useful text-ish report artifacts, and it is case-sensitive for document extensions.Steps to reproduce
Actual behavior
No media tuple is returned, so downstream gateway dispatch never calls the native document send path for the file.
Expected behavior
The
MEDIA:tag should be stripped from user-visible text and the file should be routed to the platform attachment/document sender.Impact
.MDare also missed.Proposed fix
md,html, andhtmto the sharedMEDIA:extractor allowlist..md,.MD,.html, and.htm.