Environment
- OS: Windows 10
- Hermes version: latest
- Shell: git-bash (MSYS)
- Platform: Telegram
Bug 1: MEDIA regex only matches Unix paths, not Windows paths
In gateway/platforms/base.py, the MEDIA tag extraction regex uses (?:~/|/) which only matches paths starting with ~/ or /. Windows absolute paths like C:\Users\... are silently ignored.
Steps to reproduce:
- On Windows, Hermes produces a response containing
MEDIA:C:\Users\kotsu\file.pdf
- The MEDIA tag is silently ignored, file is never attached
Expected: Windows absolute paths should be recognized.
Bug 2: send_message MEDIA fails due to restricted allowed roots
validate_media_delivery_path() in gateway/platforms/base.py rejects files outside the cache directories. Default MEDIA_DELIVERY_SAFE_ROOTS only includes cache dirs.
Workaround: Copy file to document_cache + use /c/Users/... Unix-style path.
Suggested fix: Add user home dir to allowed roots on Windows, or document HERMES_MEDIA_ALLOW_DIRS / gateway.media_delivery_allow_dirs in Windows docs.
Log evidence
2026-05-29 16:45:33 WARNING gateway.platforms.base: Skipping unsafe MEDIA directive path outside allowed roots
2026-05-29 20:57:50 WARNING gateway.platforms.base: Skipping unsafe MEDIA directive path outside allowed roots
Environment
Bug 1: MEDIA regex only matches Unix paths, not Windows paths
In
gateway/platforms/base.py, the MEDIA tag extraction regex uses(?:~/|/)which only matches paths starting with~/or/. Windows absolute paths likeC:\Users\...are silently ignored.Steps to reproduce:
MEDIA:C:\Users\kotsu\file.pdfExpected: Windows absolute paths should be recognized.
Bug 2: send_message MEDIA fails due to restricted allowed roots
validate_media_delivery_path()ingateway/platforms/base.pyrejects files outside the cache directories. DefaultMEDIA_DELIVERY_SAFE_ROOTSonly includes cache dirs.Workaround: Copy file to document_cache + use
/c/Users/...Unix-style path.Suggested fix: Add user home dir to allowed roots on Windows, or document
HERMES_MEDIA_ALLOW_DIRS/gateway.media_delivery_allow_dirsin Windows docs.Log evidence