Skip to content

fix(feishu): handle message_type "media" for video downloads#25502

Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom
4ier:fix/feishu-media-type-video
Feb 28, 2026
Merged

fix(feishu): handle message_type "media" for video downloads#25502
Takhoffman merged 2 commits intoopenclaw:mainfrom
4ier:fix/feishu-media-type-video

Conversation

@4ier
Copy link
Contributor

@4ier 4ier commented Feb 24, 2026

Summary

Feishu mobile app sends video messages with message_type: "media" instead of "video". The plugin currently only checks for "video", causing video messages to be silently dropped — the agent receives raw JSON metadata instead of the downloaded video file.

Changes

Add "media" as a fallback case alongside "video" in three locations in extensions/feishu/src/bot.ts:

  1. resolveFeishuMediaList() — add "media" to mediaTypes array
  2. parseMediaKeys() — add case "media": to extract file_key and image_key
  3. inferPlaceholder() — add case "media": to return "<media:video>"

Test Report

Environment: OpenClaw v2026.2.23, @openclaw/feishu v2026.2.23, Feishu mobile (Android)

Test Before After
Send video via Feishu mobile ❌ Agent receives raw JSON: {"file_key":"...","file_name":"...mp4","duration":15016} ✅ Video downloaded, agent receives video with AI-generated description
Gateway log msgType=media (not in mediaTypes → skipped) msgType=media → download triggered
Image messages ✅ Working ✅ Still working (no regression)

Reproduction steps:

  1. Send any video to the Feishu bot from Feishu mobile app
  2. Before fix: agent sees JSON metadata only
  3. After fix: agent receives the actual video file

Fixes #25499

Greptile Summary

Adds support for Feishu mobile app's message_type: "media" for video messages. The mobile app uses "media" instead of "video", causing videos to be dropped silently. The fix adds "media" as a fallback alongside "video" in three functions (resolveFeishuMediaList, parseMediaKeys, inferPlaceholder), treating it identically to "video" messages with both file_key and image_key.

The implementation is straightforward and follows existing patterns:

  • Added to mediaTypes array in resolveFeishuMediaList (line 349)
  • Added case fallthrough in parseMediaKeys switch statement (line 246)
  • Added case fallthrough in inferPlaceholder switch statement (line 324)

The changes are minimal, consistent, and preserve backward compatibility with existing "video" messages.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is a simple additive fix that handles a missing message type case. It follows the exact pattern already established for "video" messages, uses case fallthrough correctly, and has been tested by the author. The fix addresses a real user-facing bug where video messages from Feishu mobile were being dropped. No breaking changes, no risky refactoring, and the implementation is consistent across all three modified locations.
  • No files require special attention

Last reviewed commit: 4c73e33

(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!

@openclaw-barnacle openclaw-barnacle bot added channel: feishu Channel integration: feishu size: XS labels Feb 24, 2026
4ier and others added 2 commits February 27, 2026 22:04
Feishu mobile app sends video messages with message_type="media" instead
of "video". Add "media" as a fallback case in three locations:

1. resolveFeishuMediaList() - mediaTypes array
2. parseMediaKeys() - switch/case for file_key extraction
3. inferPlaceholder() - switch/case for placeholder text

Fixes openclaw#25499
@Takhoffman Takhoffman force-pushed the fix/feishu-media-type-video branch from 4c73e33 to d4055c8 Compare February 28, 2026 04:28
@Takhoffman Takhoffman merged commit e4cb6a8 into openclaw:main Feb 28, 2026
10 checks passed
@Takhoffman
Copy link
Contributor

PR #25502 - fix(feishu): handle message_type "media" for video downloads (#25502)

Merged via squash.

  • Merge commit: e4cb6a8
  • Verified: pnpm build, pnpm check, pnpm test:macmini
  • Changes made:
    M\textensions/feishu/src/bot.test.ts
    M\tCHANGELOG.md
  • Why these changes were made:
    The fix lacked regression coverage and changelog coverage for the new media-type handling path, so tests were added for inbound message_type: "media" and changelog was updated.
  • Changelog: CHANGELOG.md updated=true required=true opt_out=false

Thanks @4ier!

r4jiv007 pushed a commit to r4jiv007/openclaw that referenced this pull request Feb 28, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
mylukin pushed a commit to mylukin/openclaw that referenced this pull request Feb 28, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
(cherry picked from commit 512aa02)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
(cherry picked from commit 512aa02)
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Feb 28, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
(cherry picked from commit 512aa02)
vincentkoc pushed a commit to Sid-Qin/openclaw that referenced this pull request Feb 28, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
vincentkoc pushed a commit to rylena/rylen-openclaw that referenced this pull request Feb 28, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
newtontech pushed a commit to newtontech/openclaw-fork that referenced this pull request Feb 28, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
wanjizheng pushed a commit to wanjizheng/openclaw that referenced this pull request Mar 1, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
(cherry picked from commit e4cb6a8)

# Conflicts:
#	CHANGELOG.md
#	extensions/feishu/src/bot.ts
ansh pushed a commit to vibecode/openclaw that referenced this pull request Mar 2, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
safzanpirani pushed a commit to safzanpirani/clawdbot that referenced this pull request Mar 2, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
steipete pushed a commit to Sid-Qin/openclaw that referenced this pull request Mar 2, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
venjiang pushed a commit to venjiang/openclaw that referenced this pull request Mar 2, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
robertchang-ga pushed a commit to robertchang-ga/openclaw that referenced this pull request Mar 2, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
(cherry picked from commit e4cb6a8)

# Conflicts:
#	CHANGELOG.md
dorgonman pushed a commit to kanohorizonia/openclaw that referenced this pull request Mar 3, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
sachinkundu pushed a commit to sachinkundu/openclaw that referenced this pull request Mar 6, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Mateljan1 pushed a commit to Mateljan1/openclaw that referenced this pull request Mar 7, 2026
…w#25502) thanks @4ier

Verified:
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: 4ier <5648066+4ier@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: feishu Channel integration: feishu size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feishu video messages (message_type='media') not downloaded

2 participants