What happened
Commit ea49b38 ("tighten MEDIA extraction regex + silent skip on file-not-found") replaced the permissive MEDIA:\S+ regex with an explicit extension allowlist in three places. The .md (Markdown) extension was not included in the allowlist.
Where
gateway/platforms/base.py:2162 — extract_media() for final agent responses
gateway/run.py:16522 — _TOOL_MEDIA_RE for tool result history
gateway/run.py:16818 — second _TOOL_MEDIA_RE for streaming history
Impact
Agents can no longer deliver .md files to users via the MEDIA: tag. Only .txt and .csv work from the text/document group. .md was working before the regex tightening.
Suggested fix
Add |md to the extension group alongside txt|csv in all three regex patterns:
- r'txt|csv|apk|ipa))',
+ r'txt|csv|md|apk|ipa))',
Markdown is a standard document format routinely exchanged between agents and users — it belongs in the text/document group.
What happened
Commit ea49b38 ("tighten MEDIA extraction regex + silent skip on file-not-found") replaced the permissive
MEDIA:\S+regex with an explicit extension allowlist in three places. The.md(Markdown) extension was not included in the allowlist.Where
gateway/platforms/base.py:2162—extract_media()for final agent responsesgateway/run.py:16522—_TOOL_MEDIA_REfor tool result historygateway/run.py:16818— second_TOOL_MEDIA_REfor streaming historyImpact
Agents can no longer deliver
.mdfiles to users via theMEDIA:tag. Only.txtand.csvwork from the text/document group..mdwas working before the regex tightening.Suggested fix
Add
|mdto the extension group alongsidetxt|csvin all three regex patterns:Markdown is a standard document format routinely exchanged between agents and users — it belongs in the text/document group.