Skip to content

fix(gateway): add .md/.markdown to MEDIA regex extension whitelist#30106

Closed
coe0718 wants to merge 1 commit into
NousResearch:mainfrom
coe0718:fix/mediamd
Closed

fix(gateway): add .md/.markdown to MEDIA regex extension whitelist#30106
coe0718 wants to merge 1 commit into
NousResearch:mainfrom
coe0718:fix/mediamd

Conversation

@coe0718

@coe0718 coe0718 commented May 21, 2026

Copy link
Copy Markdown

The MEDIA extraction regex was tightened in ea49b3862 to require an explicit extension whitelist instead of the previous catch-all \S+ pattern, but the whitelist omitted .md and .markdown files.

This causes MEDIA:/path/to/file.md tags to be silently stripped from messages without uploading the file — the tag is removed from display text but never matched by extract_media(), so no Discord/Telegram/etc. attachment is created.

Simple fix: add md|markdown alongside the existing text-based extensions (txt|csv).

3 lines changed across 2 files (gateway/platforms/base.py + gateway/run.py).

Tested locally — applying the fix restores .md file delivery immediately.

The MEDIA extraction regex was tightened in ea49b38 to require an
explicit extension whitelist instead of the previous catch-all \S+
pattern, but the whitelist omitted .md and .markdown files.

This caused MEDIA:/path/to/file.md tags to be silently stripped from
messages without uploading the file — the tag was removed from display
text but never matched by extract_media(), so no attachment was created.

Add md|markdown alongside the existing text-based extensions (txt|csv).
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery labels May 21, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Strict subset of #29609 which dynamically derives the extension set from SUPPORTED_DOCUMENT_TYPES — the more maintainable approach. Also see #29374 (.md only, also a subset). Consider closing in favor of #29609.

@coe0718 coe0718 closed this May 21, 2026
@coe0718

coe0718 commented May 21, 2026

Copy link
Copy Markdown
Author

Sorry didn’t see those, closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants