diff --git a/gateway/platforms/base.py b/gateway/platforms/base.py index b8f74485151..76084b3cb68 100644 --- a/gateway/platforms/base.py +++ b/gateway/platforms/base.py @@ -3016,6 +3016,17 @@ class BasePlatformAdapter(ABC): expanded = os.path.expanduser(raw) if os.path.isfile(expanded): found.append((raw, expanded)) + else: + # The reply mentions a deliverable-looking path that does not + # exist on disk, so it is silently dropped from native delivery. + # This is the most common reason a promised file never arrives + # (the model said "here's your file" but never wrote it, or + # referenced the wrong path). Log it so the gap is visible in + # gateway.log rather than vanishing without a trace. + logger.info( + "Skipping bare file path in reply (no file on disk): %s", + _log_safe_path(raw), + ) # Deduplicate by expanded path, preserving discovery order seen: set = set() diff --git a/gateway/platforms/telegram.py b/gateway/platforms/telegram.py index fa55f2db004..d2b425b52b9 100644 --- a/gateway/platforms/telegram.py +++ b/gateway/platforms/telegram.py @@ -4073,7 +4073,7 @@ class TelegramAdapter(BasePlatformAdapter): ) return SendResult(success=True, message_id=str(msg.message_id)) except Exception as e: - print(f"[{self.name}] Failed to send document: {e}") + logger.warning("[%s] Failed to send document: %s", self.name, e, exc_info=True) return await super().send_document(chat_id, file_path, caption, file_name, reply_to, metadata=metadata) async def send_video( @@ -4120,7 +4120,7 @@ class TelegramAdapter(BasePlatformAdapter): ) return SendResult(success=True, message_id=str(msg.message_id)) except Exception as e: - print(f"[{self.name}] Failed to send video: {e}") + logger.warning("[%s] Failed to send video: %s", self.name, e, exc_info=True) return await super().send_video(chat_id, video_path, caption, reply_to, metadata=metadata) async def send_image(