From eca874e4f2639b6b43b2d7a274c7db8d2b70ebab Mon Sep 17 00:00:00 2001 From: Ninthkitten <165195091+Ninthkitten@users.noreply.github.com> Date: Thu, 16 Jul 2026 23:47:34 +0200 Subject: [PATCH] fix(vision): mark auto-generated image descriptions as system-provided The vision model's description is injected as user text, so chat models compliment the user's prose instead of answering about the image. Label the description as auto-generated. Co-Authored-By: Claude Fable 5 --- src/chat_handler.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/chat_handler.py b/src/chat_handler.py index f9b2a21930..3fe27b4dd7 100644 --- a/src/chat_handler.py +++ b/src/chat_handler.py @@ -272,7 +272,15 @@ async def preprocess_message( _sync_upload_vision_to_gallery(file_info, owner, vl_desc) except Exception: pass - enhanced_message = f"{enhanced_message}\n\n[Image: {file_info['name']}]\n{vl_desc}" + # Label the vision text as auto-generated — injected bare, + # chat models mistake it for the user's own writing and respond + # to the prose instead of the image. + _vl_label = f" by {vl_model}" if vl_model else "" + enhanced_message = ( + f"{enhanced_message}\n\n[Attached image: {file_info['name']} — " + f"description below was auto-generated{_vl_label}, " + f"not written by the user]\n{vl_desc}" + ) # Surface the description to the client live so it renders as a # collapsible "image description" on the user bubble (not just # after a refresh that re-parses the stored message).