hermes - 💡(How to fix) Fix Bug: MEDIA directive silently fails on Windows

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

Workaround: Copy file to document_cache + use /c/Users/... Unix-style path.

Code Example

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
RAW_BUFFERClick to expand / collapse

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:

  1. On Windows, Hermes produces a response containing MEDIA:C:\Users\kotsu\file.pdf
  2. 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Bug: MEDIA directive silently fails on Windows