Repository navigation
feat(browser): paste images into annotation comments and send them to the agent - #36004
Merged
Merged
Conversation
…aths to the agent
…ches the annotation field
…ste host for annotation images
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 43 seconds. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
[Medium impact] The latest change appears safe to merge. SummaryAdds pasted images to Design Mode comments and includes their saved paths in notes sent to agents.
Reviews (2) · Last reviewed commit: "fix(browser): release pasted edit images..." · Reviewed by Greptile |
8 of 9 tasks
This was referenced Nov 5, 2026
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.
ELI5
You can now paste a screenshot into a Design Mode comment. It shows up as a thumbnail under the comment, and when you send the notes the agent gets the image file and opens it.
What Changed
**Images (open these files):**list of the saved paths. That one string is what every route sends (an existing terminal agent, an existing native chat, a newly launched agent, and Copy), so every route carries the images. The agent opens the file itself (Claude's Read, Codex's view_image).handleAppMenuPasteRequest). It only read clipboard text and gave up when there was none, so a text field never saw an image paste. With an image-only clipboard it now falls back to a native paste, which fires the real paste event the field handles. Text pastes take the same path as before.Why
The notes already reach every agent as one markdown string, so putting the image paths in that string is the one change that covers terminal agents, native chats, new launches and Copy alike. Real per-target attachments (an inline
[Image #1]chip in a TUI,image-refblocks for native chat) would mean threading paths through the send popover,sendMessageToAgentand the quick-launch menu. A chat on a paired server would also need its files copied into that chat's attachment store at send time, which has no API today. A new agent launch would still need the text paths anyway. That is a possible follow-up.The menu-paste change sits in the shared paste owner, not in an annotation-only listener, so any text control that handles image pastes (the feedback dialog's image attachments too) now gets Cmd+V on macOS. Windows and Linux Ctrl+V already went native.
Linked Issue
Fixes #15476
Visual Proof
Before (main): an image is pasted into the comment at about 0:05 and nothing attaches.
(screenshot removed: contained real product data)
After: a real Cmd+V attaches the image as a chip, and the saved note shows its image count.
(screenshot removed: contained real product data)
Delivery: the notes sent to a native Claude chat list the image path, and Claude answers with the text drawn in the pasted image.
(screenshot removed: contained real product data)
Testing
On macOS, hidden dev build driven over CDP. Cmd+V was sent through main's
before-input-event(webContents.sendInputEvent):Real agents, each asked "what text is in the pasted image":
Tests:
formatBrowserAnnotationsAsMarkdownlists POSIX and Windows paths.handleAppMenuPasteRequestnative-pastes an image-only clipboard. That test fails without the fix.Not run here:
saveClipboardImageAsTempFilewith the worktree's connection and runtime).AI Disclosure
Review
Two rounds of Codex and Claude review, and the second round came back clean. Fixed: Cmd+V on macOS bypassing the field, preview Escape cancelling an edit or leaving Design Mode, and preview blobs held after a chip was removed or an edit ended. Left as is:
hasVisibleOverlay()would also change Escape around the open comment card, so the narrowdialog-contentexclusion stays.Agent skill upstream boundary
Notes
imagePathsis optional and lives only in renderer memory. Annotations aren't persisted or sent over the wire, so mixed versions are unaffected.To try (dev build from
/Users/kelvinamoaba/orca/workspaces/orca/browser-annotation-image-paste):Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)