hermes - 💡(How to fix) Fix DingTalk adapter does not support MEDIA/local file attachments

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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…

The DingTalk gateway adapter currently cannot deliver local files referenced through Hermes MEDIA:<path> messages. This affects PDFs and other document/image attachments generated by tools or scheduled jobs.

Error Message

  • safe fallback/error messages when the tenant/app does not have the required DingTalk permissions or message templates.

Root Cause

The DingTalk gateway adapter currently cannot deliver local files referenced through Hermes MEDIA:<path> messages. This affects PDFs and other document/image attachments generated by tools or scheduled jobs.

Code Example

DingTalk session webhook replies do not support local file attachments. Only markdown/text replies are supported without OpenAPI message send.

---

Here is the report.

   MEDIA:/tmp/example-report.pdf
RAW_BUFFERClick to expand / collapse

Summary

The DingTalk gateway adapter currently cannot deliver local files referenced through Hermes MEDIA:<path> messages. This affects PDFs and other document/image attachments generated by tools or scheduled jobs.

Current behavior

When a response contains a local media attachment, the shared gateway/media path eventually calls the platform adapter's document/image send method. For DingTalk, the adapter returns an unsupported result for local files, e.g.:

DingTalk session webhook replies do not support local file attachments. Only markdown/text replies are supported without OpenAPI message send.

In practice this means that a message body may be delivered, but the actual MEDIA:/path/to/file.pdf attachment is not delivered to DingTalk.

Expected behavior

DingTalk should either:

  1. support local MEDIA: attachments through the DingTalk OpenAPI media-upload + robot-message flow; or
  2. clearly document DingTalk as text/markdown-only and make the failure visible before users rely on MEDIA: delivery for scheduled reports.

Ideally the behavior should be consistent with other Hermes messaging platforms where tool output can include local MEDIA: attachments.

Reproduction outline

  1. Configure DingTalk gateway/stream mode.

  2. Send or schedule an agent response containing a local file attachment, for example:

    Here is the report.
    
    MEDIA:/tmp/example-report.pdf
  3. Observe that DingTalk does not receive the file attachment and the adapter reports that local file attachments are not supported.

Notes from local investigation

  • The DingTalk adapter supports markdown/text replies, but local file/image send methods are not implemented for actual attachment delivery.
  • A local experiment confirmed that DingTalk OpenAPI can obtain an access token and upload a PDF via the media upload API, so the missing piece appears to be adapter-level support for selecting the correct DingTalk robot message API/message template and routing context.
  • A robust implementation likely needs to handle at least:
    • OpenAPI access token acquisition/reuse;
    • media upload for file/image types;
    • sending the uploaded media_id via the appropriate DingTalk robot/group or one-to-one message API;
    • clear handling of robotCode, openConversationId, and private-vs-group conversation context;
    • safe fallback/error messages when the tenant/app does not have the required DingTalk permissions or message templates.

No secrets, chat IDs, tenant identifiers, or customer data are included here.

Environment

  • Hermes repository: NousResearch/hermes-agent
  • Local commit tested: ec31390a9
  • Platform: Linux
  • Messaging platform: DingTalk gateway

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…

FAQ

Expected behavior

DingTalk should either:

  1. support local MEDIA: attachments through the DingTalk OpenAPI media-upload + robot-message flow; or
  2. clearly document DingTalk as text/markdown-only and make the failure visible before users rely on MEDIA: delivery for scheduled reports.

Ideally the behavior should be consistent with other Hermes messaging platforms where tool output can include local MEDIA: attachments.

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 DingTalk adapter does not support MEDIA/local file attachments