feat(feishu): add inbound image message support#951
Closed
shikihane wants to merge 2 commits intosipeed:mainfrom
Closed
feat(feishu): add inbound image message support#951shikihane wants to merge 2 commits intosipeed:mainfrom
shikihane wants to merge 2 commits intosipeed:mainfrom
Conversation
Contributor
Author
Add image extraction from both pure image messages (MsgTypeImage) and rich text post messages (MsgTypePost) in the Feishu channel. Key changes: - Download user-sent images via MessageResource.Get API (not Image.Get, which only works for bot-uploaded images) - Parse post message format to extract embedded img tags - Use image_key as filename instead of hardcoded .jpg extension - Store downloaded images via MediaStore for media:// ref pipeline Note: This PR depends on the vision pipeline PR for resolving media:// refs to base64 data URLs before sending to the LLM. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c29cfea to
7d32d5a
Compare
- Rename shadowed err to mkErr in downloadImage (govet) - Remove unused strPtr helper in test file (unused) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Closing this PR — the inbound image support is now fully covered by #1020 (Vision Pipeline V2) which has been merged. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Add inbound image message support for the Feishu channel. When users send images (or images with text) via Feishu, the channel now downloads and stores them as
media://refs for the vision pipeline to process.Depends on: #1020 (vision pipeline — resolves
media://refs to base64 data URLs for the LLM)Changes
pkg/channels/feishu/feishu_64.go:MsgTypeImage): extractimage_keyfrom{"image_key":"..."}content, download via MessageResource APIMsgTypePost): parse{"content":[[{"tag":"img","image_key":"..."}]]}format to extract all embedded imagesdownloadImage(): usesMessageResource.Get(messageID, fileKey, type="image")— the correct API for downloading user-sent images (Image.Getonly works for bot-uploaded images)image_keyinstead of.jpg— MIME detection is handled downstream byh2non/filetypemagic bytesstore.Store()→media://ref → passed to agent viaHandleMessage()pkg/channels/feishu/feishu_64_test.go(new file):extractFeishuImageKeytests (valid key, empty, invalid JSON, missing field)extractFeishuMessageContenttests (text, image, nil message)Data flow
E2E verification
Tested on Radxa Cubie A7A (arm64) with Feishu channel + Dashscope LLM (kimi-k2.5). Sent image via Feishu, LLM correctly identified image content.
Type of Change
AI Code Generation
Test Environment
Checklist
make test)