hermes - 💡(How to fix) Fix [Bug]: WeChat gateway fails to send .html files due to MEDIA extension allowlist

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…

Error Message

Additional Logs / Traceback (optional)

Root Cause

In the WeChat file-send flow, .html files are not recognized by extract_media() because the regex only accepts this hard-coded extension list:

Fix Action

Fix / Workaround

Current Workaround

Code Example

MEDIA:/path/to/书签_分类整理_新.html

---

png|jpe?g|gif|webp|mp4|mov|avi|mkv|webm|ogg|opus|mp3|wav|m4a|flac|epub|pdf|zip|rar|7z|docx?|xlsx?|pptx?|txt|csv|apk|ipa

---

/

---



---

html?
RAW_BUFFERClick to expand / collapse

Bug Description

This happens when sending a file through the WeChat gateway.

After commit ea49b38625b4c8ee9f8aedf6c7c3e9ec36acfe69, the shared MEDIA:<path> extraction logic in gateway/platforms/base.py::extract_media() was tightened to require a hard-coded extension allowlist.

That fixed the previous false-positive issue, but it also caused valid WeChat file attachments to be silently ignored if their extension is not included in the shared regex allowlist.

I hit this with an .html file. The agent generated / attempted to send something like:

MEDIA:/path/to/书签_分类整理_新.html

but .html was not included in the extension list, so Hermes did not extract it as an attachment for the WeChat send path.

Steps to Reproduce

<img width="1260" height="526" alt="Image" src="https://github.com/user-attachments/assets/dbde618c-0d61-4b15-b8f8-7610dd85b88f" /> <img width="1296" height="340" alt="Image" src="https://github.com/user-attachments/assets/14e1d312-aca5-4508-bc53-c8ce5e6c8b81" />

Expected Behavior

When sending files through the WeChat gateway, valid local files referenced by MEDIA:<path> should be extracted and passed to the WeChat adapter as attachments.

In this case, .html files should be sent successfully.

Actual Behavior

In the WeChat file-send flow, .html files are not recognized by extract_media() because the regex only accepts this hard-coded extension list:

png|jpe?g|gif|webp|mp4|mov|avi|mkv|webm|ogg|opus|mp3|wav|m4a|flac|epub|pdf|zip|rar|7z|docx?|xlsx?|pptx?|txt|csv|apk|ipa

As a result, the file is not handed off to the WeChat adapter as an attachment.

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

No response

Debug Report

/

Operating System

Ubuntu 22.04

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

Current Workaround

Locally adding html / htm to the regex extension list allowed my WeChat file-send case to work:

html?

This fixed my immediate case, but I am reporting it because the current hard-coded allowlist missed a file type that WeChat can send as a file attachment.

Related Commit

ea49b38625b4c8ee9f8aedf6c7c3e9ec36acfe69

Environment

  • Hermes Agent: current main / post-ea49b38625b4c8ee9f8aedf6c7c3e9ec36acfe69
  • Platform: WeChat gateway
  • Code path: gateway/platforms/base.py::extract_media()
  • Reproduced with: local .html file attachment via MEDIA:<path>

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

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