fix: enable image paste in Agent sessions#14173
Open
brettschneider wants to merge 2 commits intoCherryHQ:mainfrom
Open
fix: enable image paste in Agent sessions#14173brettschneider wants to merge 2 commits intoCherryHQ:mainfrom
brettschneider wants to merge 2 commits intoCherryHQ:mainfrom
Conversation
The apiModelAdapter function was not preserving user-defined model capabilities when adapting API models for use in Agent mode. This caused vision capabilities (and other user-defined capabilities) to be lost when using models in Agent sessions, even though they worked correctly in Assistant mode. The fix looks up the model in the Redux store and copies the capabilities property if found, ensuring that user-defined settings are preserved. This addresses the issue where Ollama models with manually enabled vision showed \"model does not support images\" in Agent mode despite working in Assistant mode. Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Add images field to CreateSessionMessageRequest API schema - Read image files as base64 in AgentSessionInputbar - Pass images through message thunk to API - Update SessionMessageService to pass images to ClaudeCodeService Fixes CherryHQ#14171
9e8cedb to
1764cbe
Compare
Collaborator
|
Hi, thanks for your work! However, this PR is essentially a feature, not a fix. We are currently undergoing a large-scale architectural change from main to v2, and no new features are being accepted on the main branch—only critical fixes. Moreover, since the architecture is still in flux, I also do not recommend that you develop this feature on the v2 branch at this time. |
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.
Summary
This PR fixes the image paste functionality in Agent sessions. Previously, images were not being sent to the model - only file paths were included as text.
Changes Made
agents/index.ts): Added optionalimagesfield toCreateSessionMessageRequestswagger docsAgentSessionInputbar.tsx):messageThunk.ts):imagestoAgentSessionContexttypeagent.ts): Addedimagesfield toCreateSessionMessageRequestSchemaSessionMessageService.ts): Pass images toclaudeCodeService.invokeinstead of hardcodedundefinedHow It Works
image/) or file extensionFileManager.readBase64File()imagesfield in the request bodyresizeImageIfNeededlogicTesting
Related Issue
Fixes #14171