hermes - 💡(How to fix) Fix [Feature]: Support Telegram document thumbnails in send_message [1 pull requests]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fixed

Code Example

[[thumbnail:/tmp/preview.jpg]]
MEDIA:/tmp/report.pdf
RAW_BUFFERClick to expand / collapse

Problem or Use Case

Hermes can send files to Telegram via send_message using MEDIA:/absolute/path, but there was no way to provide Telegram Bot API sendDocument.thumbnail for document attachments such as PDFs. This makes PDF/document sends look less polished in Telegram clients when a preview image is available.

This came up while validating Telegram document delivery from the gateway: a PDF sent successfully, and the desired behavior is to let callers attach an explicit preview image.

Proposed Solution

Add a lightweight message directive for Telegram document attachments:

[[thumbnail:/tmp/preview.jpg]]
MEDIA:/tmp/report.pdf

The directive should be stripped from the visible message and forwarded to Telegram's sendDocument.thumbnail parameter when the media attachment is sent as a document. It should support quoted paths for filenames with spaces.

Implementation scope:

  • Add thumbnail_path support to the platform adapter document send API.
  • Pass thumbnail_path through the Telegram adapter to bot.send_document(thumbnail=...).
  • Teach the send_message tool to parse and strip [[thumbnail:...]] directives.
  • Add regression tests for adapter-level and send_message-level flows.

Alternatives Considered

  • Auto-generating thumbnails for every PDF: useful later, but larger in scope and more opinionated.
  • Adding a separate thumbnail argument to the public send_message schema: clearer for programmatic callers, but awkward for the existing text-plus-MEDIA: messaging pattern.
  • Encoding thumbnail metadata into the MEDIA: tag: less readable and harder to document.

Feature Type

Gateway / messaging improvement

Scope

Medium (few files, < 300 lines)

Contribution

I'd like to implement this myself and submit a PR.

Validation Notes

Manual validation was performed by sending a PDF with a generated JPEG thumbnail through Telegram; the send result was successful.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Feature]: Support Telegram document thumbnails in send_message [1 pull requests]