From 5919becab91edca1a3cc59cec1e7296a26a1a907 Mon Sep 17 00:00:00 2001 From: guitaripod Date: Sat, 14 Mar 2026 15:54:41 +0200 Subject: [PATCH] fix(telegram): route image-extension Documents through vision pipeline (#3457) Documents with image extensions (jpg, png, etc.) are routed to [Document: name] /path instead of [IMAGE:/path], bypassing the multimodal pipeline entirely. This causes the model to have no vision input for images sent as Telegram Documents. Re-applies fix from merged dev PR #1631 which was lost during the master branch migration. Co-authored-by: Argenis --- src/channels/telegram.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/channels/telegram.rs b/src/channels/telegram.rs index 1eeb65d4b..fb9e01f7f 100644 --- a/src/channels/telegram.rs +++ b/src/channels/telegram.rs @@ -179,7 +179,9 @@ fn format_attachment_content( local_path: &Path, ) -> String { match kind { - IncomingAttachmentKind::Photo if is_image_extension(local_path) => { + IncomingAttachmentKind::Photo | IncomingAttachmentKind::Document + if is_image_extension(local_path) => + { format!("[IMAGE:{}]", local_path.display()) } _ => {