hermes - ✅(Solved) Fix [Bug] Feishu and WeChat images fail with 'Invalid image source' in vision enrichment pipeline [1 pull requests, 1 comments, 1 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
NousResearch/hermes-agent#15576Fetched 2026-04-26 05:26:28
View on GitHub
Comments
1
Participants
1
Timeline
12
Reactions
0
Author
Participants
Timeline (top)
labeled ×6cross-referenced ×2referenced ×2closed ×1

Error Message

When users send images via Feishu or WeChat channels, Hermes fails to process them through the vision enrichment pipeline, throwing an "Invalid image source" error. This affects both Feishu and WeChat platforms. 3. Hermes responds with error or fails to process the image Error logged: tools.vision_tools: Error analyzing image: Invalid image source. Provide an HTTP/HTTPS URL or a valid local file path.

  1. Feishu _download_image returns empty strings on failure: When the Lark API fails to download an image, it returns ("", "") instead of None. These empty strings are appended to media_urls and passed directly to vision_analyze_tool(image_url=""), triggering the "Invalid image source" error.
  • gateway/platforms/weixin.py_download_image returns None on exception

Root Cause

Two contributing factors identified in code review:

  1. Feishu _download_image returns empty strings on failure: When the Lark API fails to download an image, it returns ("", "") instead of None. These empty strings are appended to media_urls and passed directly to vision_analyze_tool(image_url=""), triggering the "Invalid image source" error.

  2. No guard against empty paths in _enrich_message_with_vision: The gateway's _enrich_message_with_vision() function in gateway/run.py passes media_urls directly to vision_analyze_tool() without filtering out empty or None values.

Related commits:

  • 26299270 fix(feishu): wrap image bytes in BytesIO before uploading to lark SDK
  • 4e56eacd fix(vision): reject oversized images before API call, handle file:// URIs, improve 400 errors
  • 498fc678 fix(weixin): extract and deliver MEDIA: attachments in normal send() path

Fix Action

Fixed

PR fix notes

PR #15601: feat(vision): add MiniMax VL (MiniMax-M2.7) as vision backend

Description (problem / solution / changelog)

Summary

Adds MiniMax VL (MiniMax-M2.7) as a vision backend for the vision_analyze tool, enabling Hermes to automatically analyze images sent via Feishu, WeChat, and other messaging platforms using MiniMax's vision model.

Changes

  • New adapter: _MiniMaxVLAdapter translates OpenAI-compatible vision calls to MiniMax's non-standard POST /v1/coding_plan/vlm endpoint
  • Dual-format support: handles both OpenAI {"type":"image_url"} and Anthropic {"type":"image","source":{"type":"base64"}} input formats
  • Response normalization: wraps MiniMax's response in an OpenAI chat.completions-compatible shape for downstream compatibility
  • Provider routing: wired into _VISION_AUTO_PROVIDER_ORDER, _resolve_strict_vision_backend, and resolve_vision_provider_client so minimax and minimax-cn providers are recognized for vision tasks

Root Cause Fix for Issue #15576

The original issue ("Invalid image source" when sending images via Feishu/WeChat) had two contributing factors:

  1. Empty string paths: _enrich_message_with_vision passed unfiltered empty strings to vision_analyze_tool → fixed in commit c387d795
  2. Missing MiniMax VL integration: Even with valid image paths, there was no MiniMax vision backend configured → fixed by this PR

Testing

End-to-end tested via async_call_llm(task="vision", provider="minimax-cn") with real image data URI, confirmed returning correct Chinese descriptions from MiniMax-M2.7.

Checklist

  • Tests added/updated
  • Documentation updated (if applicable)
  • --- below if applicable

Changed files

  • agent/auxiliary_client.py (modified, +210/-1)
  • gateway/platforms/feishu.py (modified, +1/-1)
  • gateway/run.py (modified, +3/-1)
RAW_BUFFERClick to expand / collapse

Bug Description

When users send images via Feishu or WeChat channels, Hermes fails to process them through the vision enrichment pipeline, throwing an "Invalid image source" error. This affects both Feishu and WeChat platforms.

Steps to Reproduce

  1. Configure Hermes with Feishu or WeChat platform channel
  2. Send an image message through either platform
  3. Hermes responds with error or fails to process the image

Expected Behavior

Images sent via Feishu/WeChat should be processed by the vision pipeline like images from other platforms (Telegram, CLI).

Actual Behavior

Error logged: tools.vision_tools: Error analyzing image: Invalid image source. Provide an HTTP/HTTPS URL or a valid local file path.

Root Cause Analysis

Two contributing factors identified in code review:

  1. Feishu _download_image returns empty strings on failure: When the Lark API fails to download an image, it returns ("", "") instead of None. These empty strings are appended to media_urls and passed directly to vision_analyze_tool(image_url=""), triggering the "Invalid image source" error.

  2. No guard against empty paths in _enrich_message_with_vision: The gateway's _enrich_message_with_vision() function in gateway/run.py passes media_urls directly to vision_analyze_tool() without filtering out empty or None values.

Related commits:

  • 26299270 fix(feishu): wrap image bytes in BytesIO before uploading to lark SDK
  • 4e56eacd fix(vision): reject oversized images before API call, handle file:// URIs, improve 400 errors
  • 498fc678 fix(weixin): extract and deliver MEDIA: attachments in normal send() path

Affected Platforms

  • Feishu (Lark)
  • WeChat

Environment

  • Hermes-agent clone from NousResearch/hermes-agent
  • Platform channels: feishu, weixin
  • Vision tool: tools/vision_tools.py

Relevant Files

  • gateway/run.py_enrich_message_with_vision() passes unfiltered media_urls
  • gateway/platforms/feishu.py_download_image returns "" on failure
  • gateway/platforms/weixin.py_download_image returns None on exception
  • tools/vision_tools.py — throws "Invalid image source" for empty paths

extent analysis

TL;DR

Filter out empty or None values from media_urls before passing them to vision_analyze_tool() to prevent "Invalid image source" errors.

Guidance

  • In gateway/run.py, modify the _enrich_message_with_vision() function to filter out empty or None values from media_urls before passing them to vision_analyze_tool().
  • In gateway/platforms/feishu.py, consider changing _download_image to return None instead of empty strings on failure to maintain consistency with other platforms.
  • Verify that the vision_analyze_tool() function correctly handles filtered media_urls and that the "Invalid image source" error is resolved.
  • Review the related commits to ensure that the fixes do not introduce any regressions.

Example

# In gateway/run.py
def _enrich_message_with_vision(message, media_urls):
    # Filter out empty or None values from media_urls
    filtered_media_urls = [url for url in media_urls if url]
    for url in filtered_media_urls:
        vision_analyze_tool(image_url=url)

Notes

The provided solution assumes that the vision_analyze_tool() function can handle filtered media_urls correctly. Additional testing may be necessary to ensure that the fix does not introduce any new issues.

Recommendation

Apply the workaround by filtering out empty or None values from media_urls in the _enrich_message_with_vision() function, as this is a targeted fix that addresses the identified root cause.

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 - ✅(Solved) Fix [Bug] Feishu and WeChat images fail with 'Invalid image source' in vision enrichment pipeline [1 pull requests, 1 comments, 1 participants]