mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-01 02:32:21 +01:00
fix(chat): label the vision description injected for text-only models (#6223)
When the chat model cannot see images, the separate vision call's description is appended to the user's message. Nothing marked it as machine-derived, so the chat model read it as the user's own prose and answered the description instead of the question. The label goes below the `[Image: <name>]` marker line because the client strips the block by matching that exact prefix; renaming the marker would leave the raw description rendered in the user's bubble. Fixes #5573 Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
+7
-1
@@ -282,7 +282,13 @@ class ChatHandler:
|
||||
_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}"
|
||||
enhanced_message = f"{enhanced_message}\n\n[Image: {file_info['name']}]\n"
|
||||
if vl_desc:
|
||||
# A separate vision call wrote this, but the chat model sees
|
||||
# one message and answers the prose as if the user wrote it
|
||||
# (#5573). Label it below the marker line — the client strips
|
||||
# the block by matching `[Image: <name>]\n`.
|
||||
enhanced_message += f"[Image description — context only, not part of the user's message]:\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).
|
||||
|
||||
Reference in New Issue
Block a user