Summary
Feishu webhook image messages are parsed into structured content with imageKey, but the message router only consumes imageUrl. The parsed image therefore produces no agent content block and falls back to the generic prompt 请处理上述内容.
The repository already has a downloadImage(imageKey) capability, but the current router path does not use it because imageKey is not consumed.
Minimal Reproduction
Use this Feishu image webhook payload shape:
{
"message_type": "image",
"content": {
"image_key": "img_v2_repro"
}
}
Current source path:
parseMessageContent() creates { type: "image", imageKey: "img_v2_repro" }.
convertToContentBlocks() checks only message.content.imageUrl.
- Because
imageUrl is absent, it emits no image/content block.
extractPromptAndCwd() uses the generic non-text prompt 请处理上述内容.
Actual result: the agent receives no image content and only receives the generic prompt.
Evidence
src/main/remote/channels/feishu/feishu-channel.ts:409-426 parses image webhooks into imageKey.
src/main/remote/types.ts:320-329 allows image content to carry either imageUrl or imageKey.
src/main/remote/message-router.ts:385-407 only checks message.content.imageUrl.
src/main/remote/message-router.ts:441-469 falls back to the generic prompt for non-text content.
src/main/remote/message-router.ts:272-329 still calls the agent even when content blocks are empty.
src/main/remote/channels/feishu/feishu-api.ts:293-296 provides downloadImage(imageKey), but the router does not reach it for webhook images.
src/main/remote/channels/feishu/feishu-ws-client.ts:309-318 and src/main/remote/channels/feishu/feishu-channel.ts:266-285 use a different non-text path for WebSocket messages, so webhook and WebSocket semantics differ.
Actual Behavior
A Feishu webhook image with image_key is parsed successfully, then dropped before reaching the agent content blocks.
Expected Behavior
Webhook images represented by imageKey should be converted into agent-consumable image content, or should return an explicit unsupported/download-failed message. They should not silently become empty content plus a generic prompt.
Webhook and WebSocket Feishu non-text messages should share the same content contract.
Existing Issue / PR Coverage
Checked open and closed issues/PRs with:
Feishu image_key imageKey imageUrl message-router attachment
Feishu file voice image webhook websocket content
No direct issue or PR coverage was found.
Proposed Fix
- Share one Feishu content parser between webhook and WebSocket paths.
- In the router, handle
imageKey by using the existing Feishu image download API and producing an agent-consumable image block.
- Preserve file and voice keys, and return explicit feedback when those attachments are not supported.
- Avoid the successful path where non-text content produces empty content blocks and only the generic prompt.
Suggested Tests
- A webhook image message with
image_key produces a non-empty agent content block or a clear error.
- Webhook and WebSocket image messages follow the same semantics.
- File messages preserve
file.key.
- Voice messages do not degrade to only an opaque placeholder.
Summary
Feishu webhook image messages are parsed into structured content with
imageKey, but the message router only consumesimageUrl. The parsed image therefore produces no agent content block and falls back to the generic prompt请处理上述内容.The repository already has a
downloadImage(imageKey)capability, but the current router path does not use it becauseimageKeyis not consumed.Minimal Reproduction
Use this Feishu image webhook payload shape:
{ "message_type": "image", "content": { "image_key": "img_v2_repro" } }Current source path:
parseMessageContent()creates{ type: "image", imageKey: "img_v2_repro" }.convertToContentBlocks()checks onlymessage.content.imageUrl.imageUrlis absent, it emits no image/content block.extractPromptAndCwd()uses the generic non-text prompt请处理上述内容.Actual result: the agent receives no image content and only receives the generic prompt.
Evidence
src/main/remote/channels/feishu/feishu-channel.ts:409-426parses image webhooks intoimageKey.src/main/remote/types.ts:320-329allows image content to carry eitherimageUrlorimageKey.src/main/remote/message-router.ts:385-407only checksmessage.content.imageUrl.src/main/remote/message-router.ts:441-469falls back to the generic prompt for non-text content.src/main/remote/message-router.ts:272-329still calls the agent even when content blocks are empty.src/main/remote/channels/feishu/feishu-api.ts:293-296providesdownloadImage(imageKey), but the router does not reach it for webhook images.src/main/remote/channels/feishu/feishu-ws-client.ts:309-318andsrc/main/remote/channels/feishu/feishu-channel.ts:266-285use a different non-text path for WebSocket messages, so webhook and WebSocket semantics differ.Actual Behavior
A Feishu webhook image with
image_keyis parsed successfully, then dropped before reaching the agent content blocks.Expected Behavior
Webhook images represented by
imageKeyshould be converted into agent-consumable image content, or should return an explicit unsupported/download-failed message. They should not silently become empty content plus a generic prompt.Webhook and WebSocket Feishu non-text messages should share the same content contract.
Existing Issue / PR Coverage
Checked open and closed issues/PRs with:
Feishu image_key imageKey imageUrl message-router attachmentFeishu file voice image webhook websocket contentNo direct issue or PR coverage was found.
Proposed Fix
imageKeyby using the existing Feishu image download API and producing an agent-consumable image block.Suggested Tests
image_keyproduces a non-empty agent content block or a clear error.file.key.