Skip to content

feat(send_message): add media delivery support for Signal#13159

Closed
cdanis wants to merge 1 commit into
NousResearch:mainfrom
cdanis:fix/signal-media-delivery-raw
Closed

feat(send_message): add media delivery support for Signal#13159
cdanis wants to merge 1 commit into
NousResearch:mainfrom
cdanis:fix/signal-media-delivery-raw

Conversation

@cdanis

@cdanis cdanis commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

What

Add native media (image/PDF/file) attachment delivery to Signal via the JSON-RPC attachment API. Previously Signal was explicitly excluded from the media_delivery_supported list, so MEDIA: tags in agent responses were silently dropped for Signal recipients.

Why

Signal supports attachments natively through its JSON-RPC API ("attachments" array with url + mimeType fields). Agents often generate images (SVGs, diagrams, etc.) that should be delivered to Signal users - without this fix they get text-only responses with no media.

How it works

  • Extended _send_signal() to accept a media_files parameter
  • Media files are uploaded to the Signal gateway via the existing file upload endpoint
  • Attachments are included in the JSON-RPC request as an attachments array alongside the message text (or alone if text is empty)
  • Added Signal to the media_delivery_supported list and the restriction block platform check
  • Warning messages for omitted media now include "signal"

Tests

8 new unit tests covering: basic text, attachments with media files, missing file handling, group chat groups with attachments, restriction logic, warning messages. All 87 existing tests pass (including 79 in test_send_message_tool.py). 3 skipped tests due to httpx/telegram-bot type annotation incompatibility in this environment (not a code issue).

Diff stat

2 files changed, 226 insertions(+), 9 deletions(-)

- _send_signal now accepts an optional media_files parameter that passes
  attachments to signal-cli via the JSON-RPC API attachments array.
- Updated restriction block in _send_to_platform to include Signal alongside
  Telegram, Discord, Matrix, and Weixin as platforms with native media support.
- Added warning for non-media-capable platforms when they receive media-only
  messages (no text content).
- Tests verify: text-only sends, text+media with attachments, missing file
  warnings, group chat routing, and restriction/warning logic.
teknium1 pushed a commit that referenced this pull request Apr 20, 2026
Cherry-picked from PR #13159 by @cdanis.

Adds native media attachment delivery to Signal via signal-cli JSON-RPC
attachments param. Signal messages with media now follow the same
early-return pattern as Telegram/Discord/Matrix — attachments are sent
only with the last chunk to avoid duplicates.

Follow-up fixes on top of the original PR:
- Moved Signal into its own early-return block above the restriction
  check (matches Telegram/Discord/Matrix pattern)
- Fixed media_files being sent on every chunk in the generic loop
- Restored restriction/warning guards to simple form (Signal exits early)
- Fixed non-hermetic test writing to /tmp instead of tmp_path
ulasbilgen pushed a commit to ulasbilgen/hermes-adhd-agent that referenced this pull request May 1, 2026
Cherry-picked from PR NousResearch#13159 by @cdanis.

Adds native media attachment delivery to Signal via signal-cli JSON-RPC
attachments param. Signal messages with media now follow the same
early-return pattern as Telegram/Discord/Matrix — attachments are sent
only with the last chunk to avoid duplicates.

Follow-up fixes on top of the original PR:
- Moved Signal into its own early-return block above the restriction
  check (matches Telegram/Discord/Matrix pattern)
- Fixed media_files being sent on every chunk in the generic loop
- Restored restriction/warning guards to simple form (Signal exits early)
- Fixed non-hermetic test writing to /tmp instead of tmp_path
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
Cherry-picked from PR NousResearch#13159 by @cdanis.

Adds native media attachment delivery to Signal via signal-cli JSON-RPC
attachments param. Signal messages with media now follow the same
early-return pattern as Telegram/Discord/Matrix — attachments are sent
only with the last chunk to avoid duplicates.

Follow-up fixes on top of the original PR:
- Moved Signal into its own early-return block above the restriction
  check (matches Telegram/Discord/Matrix pattern)
- Fixed media_files being sent on every chunk in the generic loop
- Restored restriction/warning guards to simple form (Signal exits early)
- Fixed non-hermetic test writing to /tmp instead of tmp_path
Luminet2023 pushed a commit to Luminet2023/hermes-agent that referenced this pull request May 1, 2026
Cherry-picked from PR NousResearch#13159 by @cdanis.

Adds native media attachment delivery to Signal via signal-cli JSON-RPC
attachments param. Signal messages with media now follow the same
early-return pattern as Telegram/Discord/Matrix — attachments are sent
only with the last chunk to avoid duplicates.

Follow-up fixes on top of the original PR:
- Moved Signal into its own early-return block above the restriction
  check (matches Telegram/Discord/Matrix pattern)
- Fixed media_files being sent on every chunk in the generic loop
- Restored restriction/warning guards to simple form (Signal exits early)
- Fixed non-hermetic test writing to /tmp instead of tmp_path
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
Cherry-picked from PR NousResearch#13159 by @cdanis.

Adds native media attachment delivery to Signal via signal-cli JSON-RPC
attachments param. Signal messages with media now follow the same
early-return pattern as Telegram/Discord/Matrix — attachments are sent
only with the last chunk to avoid duplicates.

Follow-up fixes on top of the original PR:
- Moved Signal into its own early-return block above the restriction
  check (matches Telegram/Discord/Matrix pattern)
- Fixed media_files being sent on every chunk in the generic loop
- Restored restriction/warning guards to simple form (Signal exits early)
- Fixed non-hermetic test writing to /tmp instead of tmp_path
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Cherry-picked from PR NousResearch#13159 by @cdanis.

Adds native media attachment delivery to Signal via signal-cli JSON-RPC
attachments param. Signal messages with media now follow the same
early-return pattern as Telegram/Discord/Matrix — attachments are sent
only with the last chunk to avoid duplicates.

Follow-up fixes on top of the original PR:
- Moved Signal into its own early-return block above the restriction
  check (matches Telegram/Discord/Matrix pattern)
- Fixed media_files being sent on every chunk in the generic loop
- Restored restriction/warning guards to simple form (Signal exits early)
- Fixed non-hermetic test writing to /tmp instead of tmp_path
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Cherry-picked from PR NousResearch#13159 by @cdanis.

Adds native media attachment delivery to Signal via signal-cli JSON-RPC
attachments param. Signal messages with media now follow the same
early-return pattern as Telegram/Discord/Matrix — attachments are sent
only with the last chunk to avoid duplicates.

Follow-up fixes on top of the original PR:
- Moved Signal into its own early-return block above the restriction
  check (matches Telegram/Discord/Matrix pattern)
- Fixed media_files being sent on every chunk in the generic loop
- Restored restriction/warning guards to simple form (Signal exits early)
- Fixed non-hermetic test writing to /tmp instead of tmp_path
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