From 39b0bc377ccda020d6c6279e31a24342ee3a3a7a Mon Sep 17 00:00:00 2001 From: Aamir Jawaid Date: Thu, 30 Apr 2026 05:55:54 +0000 Subject: [PATCH] fix(teams): override send_image_file for local image attachments The gateway calls send_image_file() for locally cached images (e.g. from image_gen tools). Without this override the base class falls back to sending the file path as plain text. Delegate to send_image() which already handles base64 encoding local paths. Co-Authored-By: Claude Sonnet 4.6 --- plugins/platforms/teams/adapter.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugins/platforms/teams/adapter.py b/plugins/platforms/teams/adapter.py index 39070785a..aa0f048dd 100644 --- a/plugins/platforms/teams/adapter.py +++ b/plugins/platforms/teams/adapter.py @@ -549,6 +549,21 @@ class TeamsAdapter(BasePlatformAdapter): logger.error("[teams] send_image failed: %s", e, exc_info=True) return SendResult(success=False, error=str(e), retryable=True) + async def send_image_file( + self, + chat_id: str, + image_path: str, + caption: Optional[str] = None, + reply_to: Optional[str] = None, + **kwargs, + ) -> SendResult: + return await self.send_image( + chat_id=chat_id, + image_url=image_path, + caption=caption, + reply_to=reply_to, + ) + async def get_chat_info(self, chat_id: str) -> dict: return {"name": chat_id, "type": "unknown", "chat_id": chat_id}