mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-18 09:51:59 +00:00
fix(mattermost): set message type to DOCUMENT when post has file attachments
The Mattermost adapter downloads file attachments correctly but never updates msg_type from TEXT to DOCUMENT. This means the document enrichment block in gateway/run.py (which requires MessageType.DOCUMENT) never executes — text files are not inlined, and the agent is never notified about attached files. The user sends a file, the adapter downloads it to the local cache, but the agent sees an empty message and responds with 'I didn't receive any file'. Set msg_type to DOCUMENT when file_ids is non-empty, matching the behavior of the Telegram and Discord adapters.
This commit is contained in:
parent
0f9aa57069
commit
3282b7066c
1 changed files with 2 additions and 0 deletions
|
|
@ -661,6 +661,8 @@ class MattermostAdapter(BasePlatformAdapter):
|
|||
msg_type = MessageType.TEXT
|
||||
if message_text.startswith("/"):
|
||||
msg_type = MessageType.COMMAND
|
||||
elif file_ids:
|
||||
msg_type = MessageType.DOCUMENT
|
||||
|
||||
# Download file attachments immediately (URLs require auth headers
|
||||
# that downstream tools won't have).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue