agentscope-ai / agentscope-ai/QwenPaw

[Bug]: Feishu Channel Fails to Display Images When Message Contains Both Text and Image in Single Payload

Ouverte
#2,792 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
Python
Étoiles
34.9k
Forks
3.1k
Merge moyen
1 j 15 h
PR mergées (30 j)
225

Description

## CoPaw Version
1.0.0.post3 (output from `copaw --version`)

## Description
When sending a message that contains **both plain text content and image attachment (or markdown image)** to Feishu channel in a single send operation, only the text content is displayed in the Feishu client, with a blank line in place of the image. The full message (text + image) renders normally in the CoPaw backend chat window.
Sending text only or sending image only both work correctly in Feishu channel, the bug only occurs with mixed content in the same message.

**Security considerations:** N/A

## Component(s) Affected
- [ ] Core / Backend (app, agents, config, providers, utils, local_models)
- [ ] Console (frontend web UI)
- [X] Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
- [ ] Skills
- [ ] CLI
- [ ] Documentation (website)
- [ ] Tests
- [ ] CI/CD
- [ ] Scripts / Deploy

## Environment
- **CoPaw version:** 1.0.0.post3
- **OS:** Ubuntu 22.04 (Linux 6.8.0-87-generic x86_64)
- **Install method:** custom docker deployment
- **Python version (if applicable):** 3.10+

## Steps to Reproduce
1. Prepare a message that contains both text content and an image (either attached via send_file_to_user or as markdown image link)
2. Send this mixed-content message to Feishu channel in a single operation
3. Check Feishu client: only text appears, image position is empty/blank line
4. Verify control cases:
a. Send only text to Feishu: works normally
b. Send only image to Feishu: works normally
c. Check CoPaw backend session: mixed content message displays both text and image correctly

## Actual vs Expected
- **Actual:** Mixed (text + image) messages only show text in Feishu, image position is blank; single-type messages work as expected
- **Expected:** All message types (text-only, image-only, mixed text+image) should display completely correctly in Feishu channel

## Root Cause
Feishu client does not support standard Markdown image syntax (`![alt](url)`) embedded in text messages. When a mixed text + markdown image message is sent to Feishu channel, the Markdown image tag is ignored and rendered as a blank line, while the rest of the text content displays normally.

## Suggested Fix
Add post-processing logic for Feishu channel messages:
1. Automatically detect Markdown image links / image attachments in incoming messages
2. Separate text content and image resources from mixed messages
3. Convert the payload to Feishu's native multi-part message format (rich text message with embedded images) before sending to Feishu API, rather than passing raw Markdown content directly

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.