Skip to content

fix: add document extensions to MEDIA: path extraction regex - #14436

Closed
johnchen86 wants to merge 1 commit into
NousResearch:mainfrom
johnchen86:fix/extract-media-document-extensions
Closed

fix: add document extensions to MEDIA: path extraction regex#14436
johnchen86 wants to merge 1 commit into
NousResearch:mainfrom
johnchen86:fix/extract-media-document-extensions

Conversation

@johnchen86

Copy link
Copy Markdown

Summary

Fix BasePlatformAdapter.extract_media() to correctly extract MEDIA: tags containing document file paths (xlsx, docx, pdf, pptx, etc.).

Problem

The regex pattern only matched image/video/audio extensions, causing document paths to be truncated during extraction.

Solution

Extend the media pattern regex to include common document extensions: xlsx?, docx?, pdf, pptx, txt, csv, json, xml, zip, rar, 7z.

Testing

Verified that extract_media() now correctly extracts full document paths, and confirmed successful WeChat file delivery of xlsx files.

Extract MEDIA: tags with common document extensions (xlsx, docx, pdf,
pptx, txt, csv, json, xml, zip, rar, 7z) in addition to existing
image/video/audio extensions. Fixes file paths with document extensions
being truncated during send.
@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 Apr 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #14307 (merged) — same regex extension for document extensions in MEDIA: tag extraction. This may already be on main.

@johnchen86 johnchen86 closed this Apr 23, 2026
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