Skip to content

feat(send_message): add Feishu image/media sending support#6421

Open
dreamworld wants to merge 4 commits into
NousResearch:mainfrom
dreamworld:feature/feishu-image-send
Open

feat(send_message): add Feishu image/media sending support#6421
dreamworld wants to merge 4 commits into
NousResearch:mainfrom
dreamworld:feature/feishu-image-send

Conversation

@dreamworld

Copy link
Copy Markdown

Pass media_files to _send_feishu() which was previously missing, add Feishu to supported media platforms alongside Telegram, and only send media with the last chunk to avoid duplicate sends.

- Pass media_files to _send_feishu() which was previously missing
- Add Feishu to supported media platforms alongside Telegram
- Only send media with the last chunk to avoid duplicate sends
Copilot AI review requested due to automatic review settings April 9, 2026 05:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Feishu support for sending media attachments via send_message, aligning behavior with Telegram by attaching media only to the final chunk of a chunked message.

Changes:

  • Allow Feishu as a media-capable platform and permit media-only sends for Feishu.
  • Pass media_files through to _send_feishu() (only on the last chunk).
  • Add warning/error gating for media on platforms that don’t support native media sends.
Comments suppressed due to low confidence (1)

tools/send_message_tool.py:375

  • The error/warning strings still say media delivery is "only supported for telegram", but this change adds Feishu support too. Update the messages to include Feishu (and ideally derive the platform list from _media_supported_platforms so it stays accurate).
    if media_files and not message.strip():
        if platform not in _media_supported_platforms:
            return {
                "error": (
                    f"send_message MEDIA delivery is currently only supported for telegram; "
                    f"target {platform.value} had only media attachments"
                )
            }
    warning = None
    if media_files and platform not in _media_supported_platforms:
        warning = (
            f"MEDIA attachments were omitted for {platform.value}; "
            "native send_message media delivery is currently only supported for telegram"
        )

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/send_message_tool.py Outdated
Comment thread tools/send_message_tool.py Outdated
Liu Kang added 3 commits April 9, 2026 14:21
…dle_send

The previous PR added media_files passing to _send_feishu(), but the
root cause was that media_files was never read from args in _handle_send().
This fix reads media_files from args and converts string paths to the
(path, is_voice) tuple format expected by the sending logic.
…orted_platforms

- Update error/warning messages to include Feishu alongside Telegram
- Use dynamic platform name derivation to keep messages accurate
1. Use enumerate index instead of chunk comparison to detect last chunk
   (fixes false positive when duplicate chunks exist)
2. Add unit tests for Feishu media on last chunk and media-only send

Copilot review: NousResearch#6421
@dreamworld

Copy link
Copy Markdown
Author

✅ Resolved in commit ba48b08:

  1. is_last fix: Changed from to using index: with

  2. Tests added:

      • verifies media only on last chunk
      • verifies media-only (no text) works

Both issues fixed and tests pass.

@dreamworld

Copy link
Copy Markdown
Author

Resolving the 2 inline comments:

Comment 1 (is_last logic): Fixed in ba48b08 - now uses enumerate index instead of chunk comparison

Comment 2 (missing tests): Fixed in ba48b08 - added 2 tests:

  • test_feishu_media_attaches_to_last_chunk
  • test_feishu_media_only_send

Tests pass ✅

@alt-glitch alt-glitch added comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter type/bug Something isn't working labels Apr 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #14365 — same root cause: _send_to_platform() Feishu branch omits media_files param. See also #17083, #16920.

1 similar comment
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #14365 — same root cause: _send_to_platform() Feishu branch omits media_files param. See also #17083, #16920.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants