Fix WhatsApp native delivery for generated media#19106
Closed
hedirman wants to merge 2 commits into
Closed
Conversation
Collaborator
|
Related to #19105 — this PR fixes the issue. |
1 similar comment
Collaborator
|
Related to #19105 — this PR fixes the issue. |
b262bdd to
a099900
Compare
This was referenced May 14, 2026
Contributor
|
Superseded by independent work on
The one path your PR raised that is genuinely still open is deterministic auto-delivery of Thanks for the thorough write-up in #19105 — the issue's path-by-path breakdown is what made this easy to verify. Closing in favor of the work already on |
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
Fixes #19105.
Fixes several WhatsApp media delivery paths:
image_generateJSON results intoMEDIA:/pathattachments at the gateway layer.MEDIA:tags and JSON tool payloads.MEDIA:support tosend_messagethrough the live WhatsApp bridge adapter.Why
Generated media could succeed locally but fail or degrade at WhatsApp delivery.
For image generation, providers return JSON with an
imagefield rather than aMEDIA:/pathtag. The gateway therefore depended on the model restating the exact path correctly. Once JSON extraction was added, old image JSON in history also needed to be treated as already delivered, otherwise Hermes could send every previous generated image again.For generated MP4 outputs, such as ASCII-video renders, delivery depends on
MEDIA:/pathrouting correctly through WhatsApp.For inbound WhatsApp videos, the agent needs the real cached path, not just a placeholder.
Tests
Result:
Also ran:
Result:
Also checked syntax:
node --check scripts/whatsapp-bridge/bridge.js python -c "import ast, pathlib; ast.parse(pathlib.Path('gateway/run.py').read_text()); ast.parse(pathlib.Path('tools/send_message_tool.py').read_text())"Notes
This fixes the gateway and WhatsApp delivery side. Tools still need to create real output files and emit or return usable local paths. For ASCII-video specifically, an MP4 output should now be sent successfully when the skill/tool produces an actual file and returns it as
MEDIA:/path/to/output.mp4.