fix: pass image data to Claude in handle_photo (classic mode)#1
Merged
Conversation
PR RichardAtCT#168 added multimodal support in sdk_integration.py and facade.py but forgot to wire images= in the classic-mode handle_photo handler. Images were downloaded and base64-encoded but only a text prompt was sent to Claude — the actual photo was never seen. This reads the detected format from ProcessedImage.metadata, maps it to the correct MIME type, and passes the base64 payload via images= so Claude receives the photo as a multimodal content block. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PR RichardAtCT#168 added multimodal image support in
sdk_integration.pyandfacade.py, but forgot to wireimages=in the classic-modehandle_photohandler inmessage.py.As a result, photos sent via Telegram were downloaded and base64-encoded, but only a text prompt was passed to Claude — the actual image was never seen by the model.
Fix
In
handle_photo, after processing the image:processed_image.metadata["format"]image/jpeg,image/png, etc.)images=image_payloadtorun_commandso Claude receives the photo as a multimodal content block.Changes
src/bot/handlers/message.py— 17 lines addedTesting
Send a photo to the bot in Telegram. Claude should now actually analyze the image instead of responding with a generic "I'm sharing a screenshot" text.