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
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:
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?
Bug Description
This happens when sending a file through the WeChat gateway.
After commit
ea49b38625b4c8ee9f8aedf6c7c3e9ec36acfe69, the sharedMEDIA:<path>extraction logic ingateway/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
.htmlfile. The agent generated / attempted to send something like:but
.htmlwas not included in the extension list, so Hermes did not extract it as an attachment for the WeChat send path.Steps to Reproduce
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,
.htmlfiles should be sent successfully.Actual Behavior
In the WeChat file-send flow,
.htmlfiles are not recognized byextract_media()because the regex only accepts this hard-coded extension list: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/htmto the regex extension list allowed my WeChat file-send case to work: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
ea49b38625b4c8ee9f8aedf6c7c3e9ec36acfe69Environment
ea49b38625b4c8ee9f8aedf6c7c3e9ec36acfe69gateway/platforms/base.py::extract_media().htmlfile attachment viaMEDIA:<path>Are you willing to submit a PR for this?