openclaw - 💡(How to fix) Fix [Bug Fix] WeCom channel cannot analyze inbound images - missing stream.images assignment [1 comments, 2 participants]

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…
GitHub stats
openclaw/openclaw#69929Fetched 2026-04-22 07:46:32
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Timeline (top)
commented ×1

Error Message

When users send images through WeCom (Enterprise WeChat) channel to the Bot, the Bot cannot analyze the image content and returns an error message:

Root Cause

File: wecom-openclaw-plugin/dist/src/webhook/monitor.js
Function: startAgentForStream()
Line: ~451-467

Problem: Inbound images are correctly decrypted and saved as media.buffer, but not converted to base64 and added to stream.images array, causing the AI model to receive no image data.

Fix Action

Fix

Add the following code after line 459 (after target.runtime.log?.(\[webhook] 入站媒体已保存...):

// 🔧 Fix: If image, convert to base64 and add to stream.images for AI model analysis
if (mediaType?.startsWith("image/")) {
    const base64 = media.buffer.toString("base64");
    const md5 = computeMd5(media.buffer);
    streamStore.updateStream(streamId, (s) => {
        s.images = [{ base64, md5 }];
    });
    target.runtime.log?.(`[webhook] Inbound image added to stream.images (size=${media.buffer.length} bytes)`);
}

Code Example

I didn't receive any text in your message. Please resend or add a caption.

---

// 🔧 Fix: If image, convert to base64 and add to stream.images for AI model analysis
if (mediaType?.startsWith("image/")) {
    const base64 = media.buffer.toString("base64");
    const md5 = computeMd5(media.buffer);
    streamStore.updateStream(streamId, (s) => {
        s.images = [{ base64, md5 }];
    });
    target.runtime.log?.(`[webhook] Inbound image added to stream.images (size=${media.buffer.length} bytes)`);
}

---

{
  "channels": {
    "wecom": {
      "media": {
        "maxBytes": 52428800  // 50MB
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

title: "[Bug Fix] WeCom channel cannot analyze inbound images - missing stream.images assignment" labels: ["bug", "fix", "wecom", "high-priority"] assignees: []

Bug Description

When users send images through WeCom (Enterprise WeChat) channel to the Bot, the Bot cannot analyze the image content and returns an error message:

I didn't receive any text in your message. Please resend or add a caption.

Expected behavior: Bot should receive the image, call the vision model for analysis, and return the image description.

Root Cause

File: wecom-openclaw-plugin/dist/src/webhook/monitor.js
Function: startAgentForStream()
Line: ~451-467

Problem: Inbound images are correctly decrypted and saved as media.buffer, but not converted to base64 and added to stream.images array, causing the AI model to receive no image data.

Fix

Add the following code after line 459 (after target.runtime.log?.(\[webhook] 入站媒体已保存...):

// 🔧 Fix: If image, convert to base64 and add to stream.images for AI model analysis
if (mediaType?.startsWith("image/")) {
    const base64 = media.buffer.toString("base64");
    const md5 = computeMd5(media.buffer);
    streamStore.updateStream(streamId, (s) => {
        s.images = [{ base64, md5 }];
    });
    target.runtime.log?.(`[webhook] Inbound image added to stream.images (size=${media.buffer.length} bytes)`);
}

Testing

Environment:

  • OpenClaw: 2026.4.15
  • wecom-openclaw-plugin: 1.0.12
  • Model: bailian/qwen3.5-plus (supports image input)

Test Results:

TestImage SizeResult
1125 KB✅ Success
230 MB⚠️ Failed (exceeds size limit)
3~2 MB✅ Success

Conclusion: Fix is effective. Images <10MB can be analyzed normally.

Impact

Affected Features:

  • ❌ Image message analysis (completely broken before fix)
  • ⚠️ File message analysis (possibly affected)
  • ⚠️ Video message analysis (possibly affected)

User Impact:

  • All users using WeCom channel for image analysis
  • WeCom is an important office scenario channel

Additional Notes

Known Limitation: Large images (>20MB) may still fail due to WeCom API size limits. Users can increase the limit in config:

{
  "channels": {
    "wecom": {
      "media": {
        "maxBytes": 52428800  // 50MB
      }
    }
  }
}

Reported by: 小愚 (OpenClaw user)
Date: 2026-04-22
Local fix applied: Yes
Tested: Yes (2026-04-22 09:15 CST)

extent analysis

TL;DR

To fix the issue with the WeCom channel not analyzing inbound images, add code to convert the images to base64 and assign them to the stream.images array after decrypting and saving the media.

Guidance

  • Verify that the mediaType is correctly identified as an image by checking the mediaType?.startsWith("image/") condition.
  • Ensure the computeMd5 function is correctly calculating the MD5 hash of the image buffer.
  • Test the fix with various image sizes to confirm it works within the expected size limits.
  • Consider increasing the maxBytes limit in the WeCom channel configuration if large images are expected to be analyzed.

Example

The provided code snippet in the issue already shows the necessary fix:

if (mediaType?.startsWith("image/")) {
    const base64 = media.buffer.toString("base64");
    const md5 = computeMd5(media.buffer);
    streamStore.updateStream(streamId, (s) => {
        s.images = [{ base64, md5 }];
    });
}

Notes

The fix may not work for images larger than 20MB due to WeCom API size limits. Users can increase the limit in the config, but this may have implications for other features.

Recommendation

Apply the workaround by adding the provided code to convert images to base64 and assign them to stream.images. This fix is effective for images under 10MB, as shown in the test results.

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

openclaw - 💡(How to fix) Fix [Bug Fix] WeCom channel cannot analyze inbound images - missing stream.images assignment [1 comments, 2 participants]