OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Bug]: generate_image send:// outbound is only delivered on Feishu

Open wutongyuonce opened this issue 3 months ago • 1 comments

Issue Origin

Inferred by an AI agent and not observed or reproduced

Bug Description

generate_image writes the file under the bot data images/ directory and publishes an OutboundMessage whose content is send://<filename> (send_to_user defaults to true). Feishu parses send:// via BaseChannel._parse_data_uri and uploads the image. Telegram, Discord, and Slack do not.

Steps to Reproduce

  1. Enable the Telegram, Discord, or Slack channel on VikingBot.
  2. Ask the agent to generate an image.
  3. Watch the same chat for the reply.

Expected Behavior

The generated image is posted as an image on the channel the user spoke on.

Actual Behavior

  • Telegram: extract_image_paths treats send://uuid.png as a local path (Path(...).suffix == .png). read_image_file fails. The original send://... string is then sent as text.
  • Discord: send() POSTs JSON {content: msg.content} only. extract_image_paths is imported and unused.
  • Slack: chat_postMessage(text=msg.content) only.
  • The tool still returns "(已发送给用户)".

Feishu _extract_and_upload_images is the working consumer of the same protocol.

OpenViking Version

origin/main @ a8380147a

Python Version

3.10+

Operating System

macOS

Additional Context

Inferred from bot/vikingbot/agent/tools/image.py, channels/base.py _parse_data_uri, channels/feishu.py, channels/telegram.py, channels/discord.py, channels/slack.py. Not reproduced against live Telegram/Discord/Slack.

I am willing to contribute. Proposed fix: shared helper on BaseChannel that uses existing _parse_data_uri to turn send:// into bytes; Telegram send_photo, Discord multipart attachments, Slack files_upload_v2. Do not teach extract_image_paths to parse send://. Leave Feishu, QQ, WhatsApp, DingTalk unchanged.

wutongyuonce avatar Sep 03 '26 13:09 wutongyuonce

Proposed fix in https://github.com/volcengine/OpenViking/pull/4660 — shared _extract_send_images on BaseChannel; Telegram send_photo, Discord attachments, Slack files_upload_v2.

wutongyuonce avatar Sep 03 '26 13:09 wutongyuonce