Skip to content

fix: missing platforms in delivery maps + WhatsApp image/bridge improvements#2181

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-4a7e401e
Mar 20, 2026
Merged

fix: missing platforms in delivery maps + WhatsApp image/bridge improvements#2181
teknium1 merged 2 commits into
mainfrom
hermes/hermes-4a7e401e

Conversation

@teknium1

@teknium1 teknium1 commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Two fixes in one PR:

1. Missing platforms in cron/send_message delivery maps (follow-up to #2167)

Matrix, Mattermost, Home Assistant, and DingTalk were missing from the platform_map in both cron/scheduler.py and tools/send_message_tool.py, causing delivery to those platforms to silently fail. Also updates the cronjob tool schema description to list all available delivery targets so the model knows its options.

2. WhatsApp image downloading, bridge reuse, Baileys 7.x compat (salvage of #2162)

Salvaged from PR #2162 by @Zindar. Reply prefix changes excluded (already on main via #1756).

Bridge improvements (bridge.js):

  • Download incoming images to ~/.hermes/image_cache/ via downloadMediaMessage so the agent can actually see user-sent photos
  • Add getMessage callback required for Baileys 7.x E2EE session re-establishment
  • Build LID→phone reverse map for allowlist resolution
  • Add placeholder body for captionless media: [image received]
  • Bind express to 127.0.0.1 for security
  • Use 127.0.0.1 consistently (more reliable than localhost)

Adapter improvements (whatsapp.py):

  • Detect and reuse already-running bridge (only if status=connected)
  • Handle local file paths from bridge-cached images
  • Don't kill external bridges on disconnect

Fix vs original PR: Bridge reuse now checks status=connected, not just HTTP 200. A disconnected bridge gets restarted instead of reused.

Testing

  • All 21 WhatsApp tests pass (including fix for test_closed_when_bridge_dies_phase2)
  • All 1251 gateway tests pass
  • Bridge.js starts and binds correctly (verified live)
  • JS syntax check passes
  • Python syntax check passes

Test and others added 2 commits March 20, 2026 08:52
…l schema

Matrix, Mattermost, Home Assistant, and DingTalk were missing from the
platform_map in both cron/scheduler.py and tools/send_message_tool.py,
causing delivery to those platforms to silently fail.

Also updates the cronjob tool schema description to list all available
delivery targets so the model knows its options.
…s 7.x compat

Salvaged from PR #2162 by @Zindar. Reply prefix changes excluded (already
on main via #1756 configurable prefix).

Bridge improvements (bridge.js):
- Download incoming images to ~/.hermes/image_cache/ via downloadMediaMessage
  so the agent can actually see user-sent photos
- Add getMessage callback required for Baileys 7.x E2EE session
  re-establishment (without it, some messages arrive as null)
- Build LID→phone reverse map for allowlist resolution (WhatsApp LID format)
- Add placeholder body for media without caption: [image received]
- Bind express to 127.0.0.1 instead of 0.0.0.0 for security
- Use 127.0.0.1 consistently throughout (more reliable than localhost)

Adapter improvements (whatsapp.py):
- Detect and reuse already-running bridge (only if status=connected)
- Handle local file paths from bridge-cached images in _build_message_event
- Don't kill external bridges on disconnect
- Use 127.0.0.1 throughout for consistency with bridge binding

Fix vs original PR: bridge reuse now checks status=connected, not just
HTTP 200. A disconnected bridge gets restarted instead of reused.

Co-authored-by: Zindar <zindar@users.noreply.github.com>
@teknium1 teknium1 changed the title fix: add missing platforms to cron/send_message delivery maps and tool schema fix: missing platforms in delivery maps + WhatsApp image/bridge improvements Mar 20, 2026
@teknium1 teknium1 merged commit f961937 into main Mar 20, 2026
1 check passed
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…4a7e401e

fix: missing platforms in delivery maps + WhatsApp image/bridge improvements
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…4a7e401e

fix: missing platforms in delivery maps + WhatsApp image/bridge improvements
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…4a7e401e

fix: missing platforms in delivery maps + WhatsApp image/bridge improvements
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…4a7e401e

fix: missing platforms in delivery maps + WhatsApp image/bridge improvements
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…4a7e401e

fix: missing platforms in delivery maps + WhatsApp image/bridge improvements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant