Bug Description
When pasting an image into an Agent session, the image is not properly sent to the model. Instead, only the file path is sent as text, and the model returns an error about image dimensions exceeding 2000x2000px.
Steps to Reproduce
- Create a new Agent session
- Take a screenshot or copy an image to clipboard
- Paste into the chat input (Cmd+V on Mac)
- Send the message
Expected Behavior
The image should display in the chat and the model should analyze it (same as Assistant mode).
Actual Behavior
- Image is displayed as text:
Attached files: /var/folders/.../temp_file_xxx_image.png
- Model returns error: "Unable to resize image — dimensions exceed the 2000x2000px limit"
- Model cannot analyze the image
Root Cause
The Agent session code appends file paths to the message text instead of uploading the image data. The API request does not include an images field.
Environment
- Cherry Studio version: [latest main]
- OS: macOS (affects all platforms)
Additional Context
The fix requires:
- Adding
images field to CreateSessionMessageRequest
- Reading image files as base64 in AgentSessionInputbar
- Passing images through the API to the backend service
- Processing images in ClaudeCodeService (already implemented)
Bug Description
When pasting an image into an Agent session, the image is not properly sent to the model. Instead, only the file path is sent as text, and the model returns an error about image dimensions exceeding 2000x2000px.
Steps to Reproduce
Expected Behavior
The image should display in the chat and the model should analyze it (same as Assistant mode).
Actual Behavior
Attached files: /var/folders/.../temp_file_xxx_image.pngRoot Cause
The Agent session code appends file paths to the message text instead of uploading the image data. The API request does not include an
imagesfield.Environment
Additional Context
The fix requires:
imagesfield toCreateSessionMessageRequest