openclaw - 💡(How to fix) Fix [Bug]: DingTalk channel: agent-generated images not delivered via session reply dispatcher

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…

DingTalk session reply dispatcher only forwards text/markdown to sendBySession(), never passes mediaPath/mediaType, so agent-generated images (e.g. from lovart-api) are never delivered as DingTalk image messages — while the same images display fine in XClaw webchat.

Root Cause

Root cause identified in the DingTalk extension source code (~/.openclaw/extensions/dingtalk/dist/src/):

Fix Action

Fix / Workaround

DingTalk session reply dispatcher only forwards text/markdown to sendBySession(), never passes mediaPath/mediaType, so agent-generated images (e.g. from lovart-api) are never delivered as DingTalk image messages — while the same images display fine in XClaw webchat.

Agent-generated images should be delivered as native DingTalk image messages through sendBySession() with mediaPath + mediaType, just like webchat can display them. sendBySession() already supports this — the code path for image delivery exists but is never reached from the reply dispatcher.

Only text/markdown content is delivered to the DingTalk conversation. Images generated by the agent are silently lost — they never appear in the chat. The inbound-handler.js dispatchReplyWithBufferedBlockDispatcher deliver function only passes payload.markdown/payload.text to sendMessage(), never mediaPath/mediaType. Meanwhile sendBySession() has a working image delivery path using msgtype: "image" with media_id, but it is unreachable from the dispatcher.

Code Example



---

deliver: async (payload, info) => {
    const textToSend = payload.markdown || payload.text;
    // ...only sends text, never mediaPath/mediaType
    await sendMessage(dingtalkConfig, to, textToSend, {
        sessionWebhook, atUserId, log, accountId,
    });
}

---

if (options.mediaPath && options.mediaType) {
    const mediaId = await uploadMedia(...);
    body = { msgtype: "image", image: { media_id: mediaId } };
}
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

DingTalk session reply dispatcher only forwards text/markdown to sendBySession(), never passes mediaPath/mediaType, so agent-generated images (e.g. from lovart-api) are never delivered as DingTalk image messages — while the same images display fine in XClaw webchat.

Steps to reproduce

  1. Configure DingTalk channel with image generation skill (e.g. lovart-api)
  2. Send a message like "画一只猫" in DingTalk
  3. Observe: generation completes, text reply appears, but no image shows in DingTalk
  4. Send same prompt in XClaw webchat → image displays correctly

Expected behavior

Agent-generated images should be delivered as native DingTalk image messages through sendBySession() with mediaPath + mediaType, just like webchat can display them. sendBySession() already supports this — the code path for image delivery exists but is never reached from the reply dispatcher.

Actual behavior

Only text/markdown content is delivered to the DingTalk conversation. Images generated by the agent are silently lost — they never appear in the chat. The inbound-handler.js dispatchReplyWithBufferedBlockDispatcher deliver function only passes payload.markdown/payload.text to sendMessage(), never mediaPath/mediaType. Meanwhile sendBySession() has a working image delivery path using msgtype: "image" with media_id, but it is unreachable from the dispatcher.

OpenClaw version

2026.5.6

Operating system

macOS 26 (Sequoia), Apple Silicon

Install method

mac app (XClaw)

Model

deepseek/deepseek-v4-pro

Provider / routing chain

openclaw -> deepseek

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Affected: All DingTalk channel users with image generation skills Severity: High (blocks core image generation workflow on DingTalk) Frequency: 100% reproducible Consequence: Users must switch to XClaw webchat to see generated images; DingTalk image feature is effectively broken

Additional information

Root cause identified in the DingTalk extension source code (~/.openclaw/extensions/dingtalk/dist/src/):

inbound-handler.js — the dispatchReplyWithBufferedBlockDispatcher deliver function:

deliver: async (payload, info) => {
    const textToSend = payload.markdown || payload.text;
    // ...only sends text, never mediaPath/mediaType
    await sendMessage(dingtalkConfig, to, textToSend, {
        sessionWebhook, atUserId, log, accountId,
    });
}

send-service.js — sendBySession() already supports images but needs options.mediaPath + options.mediaType:

if (options.mediaPath && options.mediaType) {
    const mediaId = await uploadMedia(...);
    body = { msgtype: "image", image: { media_id: mediaId } };
}

The workaround (manual message tool) uses outbound.sendMedia → sendProactiveMedia which works, but this path is not accessible from the automatic reply dispatcher.DingTalk extension is bundled with the mac app. The issue is in the inbound reply dispatcher not passing media attachment metadata through to sendBySession(). The sendBySession() code path for image delivery (upload + msgtype: "image") exists and works when called directly — just not reachable from the automatic reply flow.

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

Agent-generated images should be delivered as native DingTalk image messages through sendBySession() with mediaPath + mediaType, just like webchat can display them. sendBySession() already supports this — the code path for image delivery exists but is never reached from the reply dispatcher.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: DingTalk channel: agent-generated images not delivered via session reply dispatcher