From ecaf8008bb6f83df6d7094e0dec77d62a7bb8531 Mon Sep 17 00:00:00 2001 From: loongzhao Date: Wed, 29 Apr 2026 04:52:48 -0700 Subject: [PATCH] feat(yuanbao): wire native text + media delivery into send_message _send_yuanbao() already supported media_files= and the user-facing error strings already advertised yuanbao support, but there was no dispatch branch in _send_to_platform() actually routing to it. Target yuanbao in send_message previously fell through to "Direct sending not yet implemented". - Add yuanbao media-chunk branch (mirrors Signal/Matrix: media on final chunk only). - Add yuanbao elif in the non-media loop. Salvage of #17411; SKILL.md description change and redundant sidebars.ts entry dropped, indentation/trailing-whitespace cleaned up. --- tools/send_message_tool.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/send_message_tool.py b/tools/send_message_tool.py index a2321c2e..e282f4c2 100644 --- a/tools/send_message_tool.py +++ b/tools/send_message_tool.py @@ -556,6 +556,21 @@ async def _send_to_platform(platform, pconfig, chat_id, message, thread_id=None, last_result = result return last_result + # --- Yuanbao: native media attachment support via running gateway adapter --- + if platform == Platform.YUANBAO and media_files: + last_result = None + for i, chunk in enumerate(chunks): + is_last = (i == len(chunks) - 1) + result = await _send_yuanbao( + chat_id, + chunk, + media_files=media_files if is_last else None, + ) + if isinstance(result, dict) and result.get("error"): + return result + last_result = result + return last_result + # --- Non-media platforms --- if media_files and not message.strip(): return { @@ -599,6 +614,8 @@ async def _send_to_platform(platform, pconfig, chat_id, message, thread_id=None, result = await _send_bluebubbles(pconfig.extra, chat_id, chunk) elif platform == Platform.QQBOT: result = await _send_qqbot(pconfig, chat_id, chunk) + elif platform == Platform.YUANBAO: + result = await _send_yuanbao(chat_id, chunk) else: result = {"error": f"Direct sending not yet implemented for {platform.value}"}