fix(whatsapp): download documents, audio, and video media from messages#2978
Merged
fix(whatsapp): download documents, audio, and video media from messages#2978
Conversation
Add downloadMediaMessage() calls for documents, audio/voice notes, and video in bridge.js — previously only images were downloaded, leaving all other file types inaccessible to the agent. Handle local file paths from the bridge for DOCUMENT, VOICE, and VIDEO types in whatsapp.py with proper MIME detection. Inject text content inline for readable files (.txt, .md, .csv, .json, etc.). Follow-up fixes applied during salvage: - Remove unused cache_document_from_bytes import - Add 100KB size cap on text injection (matches Telegram/Discord/Slack) - Align injection format with other platforms Cherry-picked from PR #2818. Also fixes #2856 (bugs 1 & 2). PR #2865 by ayberkesn fixed the same voice note issue.
InB4DevOps
pushed a commit
to InB4DevOps/hermes-agent
that referenced
this pull request
Mar 25, 2026
…es (NousResearch#2978) Add downloadMediaMessage() calls for documents, audio/voice notes, and video in bridge.js — previously only images were downloaded, leaving all other file types inaccessible to the agent. Handle local file paths from the bridge for DOCUMENT, VOICE, and VIDEO types in whatsapp.py with proper MIME detection. Inject text content inline for readable files (.txt, .md, .csv, .json, etc.). Follow-up fixes applied during salvage: - Remove unused cache_document_from_bytes import - Add 100KB size cap on text injection (matches Telegram/Discord/Slack) - Align injection format with other platforms Cherry-picked from PR NousResearch#2818. Also fixes NousResearch#2856 (bugs 1 & 2). PR NousResearch#2865 by ayberkesn fixed the same voice note issue. Co-authored-by: noestelar <hola@noeali.com>
outsourc-e
pushed a commit
to outsourc-e/hermes-agent
that referenced
this pull request
Mar 26, 2026
…es (NousResearch#2978) Add downloadMediaMessage() calls for documents, audio/voice notes, and video in bridge.js — previously only images were downloaded, leaving all other file types inaccessible to the agent. Handle local file paths from the bridge for DOCUMENT, VOICE, and VIDEO types in whatsapp.py with proper MIME detection. Inject text content inline for readable files (.txt, .md, .csv, .json, etc.). Follow-up fixes applied during salvage: - Remove unused cache_document_from_bytes import - Add 100KB size cap on text injection (matches Telegram/Discord/Slack) - Align injection format with other platforms Cherry-picked from PR NousResearch#2818. Also fixes NousResearch#2856 (bugs 1 & 2). PR NousResearch#2865 by ayberkesn fixed the same voice note issue. Co-authored-by: noestelar <hola@noeali.com>
StreamOfRon
pushed a commit
to StreamOfRon/hermes-agent
that referenced
this pull request
Mar 29, 2026
…es (NousResearch#2978) Add downloadMediaMessage() calls for documents, audio/voice notes, and video in bridge.js — previously only images were downloaded, leaving all other file types inaccessible to the agent. Handle local file paths from the bridge for DOCUMENT, VOICE, and VIDEO types in whatsapp.py with proper MIME detection. Inject text content inline for readable files (.txt, .md, .csv, .json, etc.). Follow-up fixes applied during salvage: - Remove unused cache_document_from_bytes import - Add 100KB size cap on text injection (matches Telegram/Discord/Slack) - Align injection format with other platforms Cherry-picked from PR NousResearch#2818. Also fixes NousResearch#2856 (bugs 1 & 2). PR NousResearch#2865 by ayberkesn fixed the same voice note issue. Co-authored-by: noestelar <hola@noeali.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Salvage of PR #2818 by @noestelar onto current main. Also addresses the voice note bug reported in #2856 (which PR #2865 by @ayberkesn also fixed).
What this does: The WhatsApp bridge only downloaded images — documents, audio/voice notes, and video were detected (
hasMedia = true) but never actually downloaded viadownloadMediaMessage(). This meantmediaUrlsstayed empty and the agent couldn't access these files.Changes
bridge.js:
downloadMediaMessage()for video (→document_cache/), audio/ptt (→audio_cache/), and documents (→document_cache/with sanitized filenames)image_cache/for everythingwhatsapp.py:
SUPPORTED_DOCUMENT_TYPESmap for documentsFollow-up fixes (applied during salvage)
cache_document_from_bytesimport[Content of name]:instead of markdown)Fixes #2856 (bugs 1 & 2).
Contributor credit: @noestelar (primary implementation), @ayberkesn (independent voice note fix in #2865).