fix(feishu): use msg_type "audio" for opus files instead of "media"#28269
fix(feishu): use msg_type "audio" for opus files instead of "media"#28269Takhoffman merged 3 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryFixed Feishu audio message handling by correctly mapping opus files to
Issue found: Test file Confidence Score: 3/5
Last reviewed commit: 2426fcd |
| // Feishu requires msg_type "media" for audio/video, "file" for documents | ||
| const isMedia = fileType === "mp4" || fileType === "opus"; | ||
| // Feishu API: opus -> "audio", mp4 -> "media", everything else -> "file" | ||
| const msgType = fileType === "opus" ? "audio" : fileType === "mp4" ? "media" : "file"; |
There was a problem hiding this comment.
Test case needs update in media.test.ts:132-151. The test "uses msg_type=media for opus" expects msg_type: "media" but should now expect msg_type: "audio"
| const msgType = fileType === "opus" ? "audio" : fileType === "mp4" ? "media" : "file"; | |
| // Test update needed: rename test to "uses msg_type=audio for opus" and change assertion to expect msg_type: "audio" |
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/feishu/src/media.ts
Line: 431
Comment:
Test case needs update in `media.test.ts:132-151`. The test "uses msg_type=media for opus" expects `msg_type: "media"` but should now expect `msg_type: "audio"`
```suggestion
// Test update needed: rename test to "uses msg_type=audio for opus" and change assertion to expect msg_type: "audio"
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Addressed in 0ef6fc2 — the test was updated to assert msg_type: "audio" and renamed accordingly.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2426fcd6be
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Feishu requires msg_type "media" for audio/video, "file" for documents | ||
| const isMedia = fileType === "mp4" || fileType === "opus"; | ||
| // Feishu API: opus -> "audio", mp4 -> "media", everything else -> "file" | ||
| const msgType = fileType === "opus" ? "audio" : fileType === "mp4" ? "media" : "file"; |
There was a problem hiding this comment.
Update opus routing assertions to match new msg_type
This change routes .opus files to msg_type: "audio", but the existing unit test still asserts msg_type: "media" for opus (extensions/feishu/src/media.test.ts, uses msg_type=media for opus), so the Feishu media test suite will fail once this commit lands. Please update the test expectation in the same change to keep CI green and prevent future regressions from being masked by a known-failing assertion.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in 0ef6fc2 — test expectation updated to msg_type: "audio" for opus files, matching the new routing logic.
ebdcf74 to
132ead0
Compare
132ead0 to
a96c7c0
Compare
|
PR #28269 - fix(feishu): use msg_type "audio" for opus files instead of "media" (#28269) Merged via squash.
Thanks @Glucksberg! |
|
Correction: merge commit SHA is 0e755ad |
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 1fdfa9a)
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 1fdfa9a)
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 1fdfa9a)
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 0e755ad) # Conflicts: # CHANGELOG.md # extensions/feishu/src/media.ts
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 0e755ad) # Conflicts: # CHANGELOG.md
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…penclaw#28269) thanks @Glucksberg Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Summary
sendMediaFeishusendsmsg_type: "media"for both audio and videomsg_type: "audio"while video files usemsg_type: "media"sendFileFeishutype signature to accept"audio"as a validmsgTypeCloses #25464
Test plan
.opusaudio file via Feishu and verify it arrives as a playable voice message (not a fallback text).mp4video file via Feishu and verify it still works withmsg_type: "media"msg_type: "file"🤖 Generated with Claude Code