Skip to content

Bug: Image paste does not work in Agent sessions #14171

@brettschneider

Description

@brettschneider

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

  1. Create a new Agent session
  2. Take a screenshot or copy an image to clipboard
  3. Paste into the chat input (Cmd+V on Mac)
  4. 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:

  1. Adding images field to CreateSessionMessageRequest
  2. Reading image files as base64 in AgentSessionInputbar
  3. Passing images through the API to the backend service
  4. Processing images in ClaudeCodeService (already implemented)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions